4

the source code of latex:

\documentclass[12pt]{article}
\usepackage[no-math]{fontspec}
\setmainfont{Noto Sans CJK SC}
\setmonofont{Noto Sans Mono CJK SC}
\setsansfont{Noto Sans CJK SC}  
\begin{document}
我是
\end{document}

the name of Noto Sans CJK SC if from fc-list

/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK JP,Noto Sans CJK JP Regular:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK KR,Noto Sans CJK KR Regular:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK SC,Noto Sans CJK SC Regular:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK TC,Noto Sans CJK TC Regular:style=Regular

then I use adobe reader to open the output pdf file and select file,properties,fonts.

it shows that the font is NotoSansCJKjp-Regular. However, I set

\setmainfont{Noto Sans CJK SC}

in the source file, the font should be NotoSansCJKsc-Regular. I also try other font Noto Sans CJK TC and Noto Sans CJK KR, all of them reduce to NotoSansCJKjp-Regular.

How to fix the problem?

However, lualatex give me the correct front. That means use adobe reader to open the output pdf file and select file,properties,fonts. It shows that the font is NotoSansCJKsc-Regular.

I use texlive 2016 and ubuntu 16.04.

I add \XeTeXtracingfonts=1 to my source file and see:

Requested font "Noto Sans CJK SC" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
\g__fontspec_family_NotoSansCJKSC_int=\count121
Requested font "Noto Sans CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans CJK SC/BI/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
Requested font "Noto Sans CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans CJK SC/B/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
Requested font "Noto Sans CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans CJK SC/I/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
.................................................
. fontspec info: "no-font-shape"
. 
. Could not resolve font Noto Sans CJK SC/I (it probably doesn't exist).
.................................................
Requested font "Noto Sans CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans CJK SC/B/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
Requested font "Noto Sans CJK SC/B/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
Requested font "Noto Sans CJK SC/BI/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
Requested font "Noto Sans CJK SC/BI/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
.................................................
. fontspec info: "defining-font"
. 
. Font family 'NotoSansCJKSC(0)' created for font 'Noto Sans CJK SC' with
. options [Ligatures=TeX].
. 
. This font family consists of the following NFSS series/shapes:
. - 'normal' (m/n) with NFSS spec.: <->"Noto Sans CJK
. SC/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'small caps'  (m/sc) with NFSS spec.: - 'bold' (bx/n) with NFSS spec.:
. <->"Noto Sans CJK SC/B/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold small caps'  (bx/sc) with NFSS spec.: - 'bold italic' (bx/it) with
. NFSS spec.: <->"Noto Sans CJK
. SC/BI/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold italic small caps'  (bx/itsc) with NFSS spec.: 
.................................................
Requested font "Noto Sans CJK SC/OT:script=latn;language=DFLT;mapping=tex-text;
" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans Mono CJK SC" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans Mono CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
\g__fontspec_family_NotoSansMonoCJKSC_int=\count122
Requested font "Noto Sans Mono CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans Mono CJK SC/BI/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
Requested font "Noto Sans Mono CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans Mono CJK SC/B/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
 Requested font "Noto Sans Mono CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans Mono CJK SC/I/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
.................................................
. fontspec info: "no-font-shape"
. 
. Could not resolve font Noto Sans Mono CJK SC/I (it probably doesn't exist).
.................................................
Requested font "Noto Sans Mono CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans Mono CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans Mono CJK SC/B/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
Requested font "Noto Sans Mono CJK SC/B/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
Requested font "Noto Sans Mono CJK SC/BI/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
Requested font "Noto Sans Mono CJK SC/BI/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
.................................................
. fontspec info: "defining-font"
. 
. Font family 'NotoSansMonoCJKSC(0)' created for font 'Noto Sans Mono CJK SC'
. with options [WordSpace={1,0,0},PunctuationSpace=WordSpace].
. 
. This font family consists of the following NFSS series/shapes:
. - 'normal' (m/n) with NFSS spec.: <->"Noto Sans Mono CJK
. SC/OT:script=latn;language=DFLT;"
. - 'small caps'  (m/sc) with NFSS spec.: 
. and font adjustment code:
. \fontdimen 2\font =1\fontdimen 2\font \fontdimen 3\font =0\fontdimen 3\font
. \fontdimen 4\font =0\fontdimen 4\font \fontdimen 7\font =0\fontdimen 2\font
. - 'bold' (bx/n) with NFSS spec.: <->"Noto Sans Mono CJK
. SC/B/OT:script=latn;language=DFLT;"
. - 'bold small caps'  (bx/sc) with NFSS spec.: 
. and font adjustment code:
. \fontdimen 2\font =1\fontdimen 2\font \fontdimen 3\font =0\fontdimen 3\font
. \fontdimen 4\font =0\fontdimen 4\font \fontdimen 7\font =0\fontdimen 2\font
. - 'bold italic' (bx/it) with NFSS spec.: <->"Noto Sans Mono CJK
. SC/BI/OT:script=latn;language=DFLT;"
. - 'bold italic small caps'  (bx/itsc) with NFSS spec.: 
. and font adjustment code:
. \fontdimen 2\font =1\fontdimen 2\font \fontdimen 3\font =0\fontdimen 3\font
 . \fontdimen 4\font =0\fontdimen 4\font \fontdimen 7\font =0\fontdimen 2\font 
.................................................
Requested font "Noto Sans CJK SC" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc

The last of the output:

Requested font "Noto Sans CJK SC" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
Requested font "Noto Sans CJK SC/OT" at 12.0pt
 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc

From the website of noto cjk https://www.google.com/get/noto/help/cjk/

CJK OTF fonts with different default language (S Chinese, T Chinese,
Japanese, and Korean packages). Each font file supports all four 
languages. However, you need an application program that can invoke an  
opentype locl feature (e.g. Adobe InDesign) to access language-specific 
variants other than the default language. 

It seems that xelatex can not invoke the opentype locl feature and just get the default language. But from the https://en.wikipedia.org/wiki/XeTeX

Support for OpenType local typographic conventions (locl tag) is also present

Maybe I need to find some way to use the locl tag, but how to?

  • What does the output on the console or in the .log say? – cfr Oct 18 '16 at 1:48
  • Does the actual output differ at all? – cfr Oct 18 '16 at 1:57
  • The output looks different. log of xelatex says:fontspec info: "no-font-shape" Could not resolve font Noto Sans CJK SC/I (it probably doesn't exist). But there is not such stuff of lualatex log. – ken Oct 18 '16 at 3:01
  • 1
    Add \XeTeXtracingfonts=1 and then check in the log-file which actual font file XeTeX is finding. – Ulrike Fischer Oct 18 '16 at 7:23
  • @UlrikeFischer Can XeTeX handly truetype containers? On my machine, at least, these fonts are of type TTC. – cfr Oct 18 '16 at 14:18
1

From the Noto Sans CJK website you mentioned https://www.google.com/get/noto/help/cjk/

Noto Sans CJK fonts come in four packaging formats. Glyph designs are identical regardless of the packaging format.

Despite it is not clear why Noto San CJK JP is loaded under xetex mode, you can try to specify the option Language explicitly to get correct glyphs.

\documentclass[12pt]{article}
\usepackage[no-math]{fontspec}
\begin{document}
\LARGE
{
\fontspec{Noto Sans CJK SC}
我是 Noto Sans CJK SC

我能吞下玻璃而不伤身体。
}

{
\fontspec{Noto Sans CJK SC}[Language=Japanese]
我是 Noto Sans CJK SC,  jan

我能吞下玻璃而不伤身体。
}

{
\fontspec{Noto Sans CJK SC}[Language={Chinese Simplified}]
我是 Noto Sans CJK SC, zhs

我能吞下玻璃而不伤身体。
}

{
\fontspec{Source Han Sans SC Regular}
我是 Source Han Sans SC Regular

我能吞下玻璃而不伤身体。

简体中文测试。
}

\end{document}

The last one is Source Han Sans SC, an alias of Noto Sans CJK SC named by Adobe and is tested here as a benchmark. You can be downloaded from github.

Compare the difference among these fonts with/without option Language, e.g. the effects of character 能.

See the document of fontspec for details of Language option (section 10.18 and 28.0.22).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.