使用 Noto Sans 和 fontspec 会加载错误的语言

使用 Noto Sans 和 fontspec 会加载错误的语言

我正在尝试使用该包和 LuaLaTeX 用 Google 的 Noto Sans 字体排版文档fontspec。但是,当我运行 时lualatex,它会获取错误语言的字体文件,因此它生成的 PDF 是空白的。这是一个最简单的例子:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Noto Sans}

\begin{document}
Lorem ipsum dolor sit amet.
\end{document}

当我运行lualatex包含此内容的文件时,我得到以下输出:

This is LuaTeX, Version 0.95.0 (TeX Live 2016) 
 restricted system commands enabled.
(./mcve.ltx
LaTeX2e <2016/03/31> patch level 2
Babel <3.9r> and hyphenation patterns for 1 language(s) loaded.
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2016/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/local/texlive/2016/texmf-dist/tex/latex/l3kernel/l3pdfmode.def))
(/usr/local/texlive/2016/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(/usr/local/texlive/2016/texmf-dist/tex/luatex/luaotfload/luaotfload.sty(using 
cache: /usr/local/texlive/2016/texmf-var/luatex-cache/generic)
luaotfload | main : initialization completed in 0.167 seconds)
(/usr/local/texlive/2016/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/euenc/eu2enc.def)
(/usr/local/texlive/2016/texmf-dist/tex/latex/euenc/eu2lmr.fd)(load luc: /usr/l
ocal/texlive/2016/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.lu
c)) (/usr/local/texlive/2016/texmf-dist/tex/xelatex/xunicode/xunicode.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/tipa/t3enc.def(load luc: /usr/loc
al/texlive/2016/texmf-var/luatex-cache/generic/fonts/otl/lmromanslant10-regular
.luc)(load luc: /usr/local/texlive/2016/texmf-var/luatex-cache/generic/fonts/ot
l/lmroman10-italic.luc)(load luc: /usr/local/texlive/2016/texmf-var/luatex-cach
e/generic/fonts/otl/lmroman10-bold.luc)
(/usr/local/texlive/2016/texmf-dist/tex/latex/euenc/eu2lmss.fd)(load luc: /usr/
local/texlive/2016/texmf-var/luatex-cache/generic/fonts/otl/lmsans10-regular.lu
c)) (/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics-def/luatex.def
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)))))
(/usr/local/texlive/2016/texmf-dist/tex/latex/fontspec/fontspec.cfg)))(load luc
: /usr/local/texlive/2016/texmf-var/luatex-cache/generic/fonts/otl/notosanscham
-regular.luc)(load luc: /usr/local/texlive/2016/texmf-var/luatex-cache/generic/
fonts/otl/notosans-bolditalic.luc)(load luc: /usr/local/texlive/2016/texmf-var/
luatex-cache/generic/fonts/otl/notosans-bold.luc)(load luc: /usr/local/texlive/
2016/texmf-var/luatex-cache/generic/fonts/otl/notosans-italic.luc) (./mcve.aux)
(/usr/local/texlive/2016/texmf-dist/tex/latex/tipa/t3cmr.fd)
(/usr/local/texlive/2016/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/grfext.sty
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty))
(/usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/etexcmds.sty
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/ifluatex.sty))))
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/luatex-loader.sty
(/usr/local/texlive/2016/texmf-dist/scripts/oberdiek/oberdiek.luatex.lua)))
(/usr/local/texlive/2016/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
[1{/usr/local/texlive/2016/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./mcve.aux))
(see the transcript file for additional information)
 396 words of node memory still in use:
   3 hlist, 1 vlist, 1 rule, 7 glue, 4 attribute, 44 glue_spec, 4 attribute_lis
t, 1 write nodes
   avail lists: 2:13,3:3,4:2,5:10,6:27,7:26,8:1,9:6,11:2
</usr/share/fonts/TTF/NotoSansCham-Regular.ttf>
Output written on mcve.pdf (1 page, 2939 bytes).
Transcript written on mcve.log.

如您所见,它正在加载字体文件NotoSansCham-Regular.ttf,该文件适用于 Cham 语言,这与NotoSans-Regular.ttf我预期的不同。我如何才能lualatex找到正确的字体文件?

编辑:这也是日志文件。它不允许我发布完整的文件,所以我删除了一些我认为不重要的部分。如果有遗漏,请告诉我。

This is LuaTeX, Version 0.95.0 (TeX Live 2016)  (format=lualatex 2016.7.31)  4 AUG 2016 22:45
 restricted system commands enabled.
**mcve.ltx
(./mcve.ltx
LaTeX2e <2016/03/31> patch level 2

...snip...

(/usr/local/texlive/2016/texmf-dist/tex/latex/fontspec/fontspec.sty

...snip...

Package: fontspec 2016/02/01 v2.5a Font selection for XeLaTeX and LuaLaTeX

(/usr/local/texlive/2016/texmf-dist/tex/luatex/luaotfload/luaotfload.sty
Package: luaotfload 2016/06/16 v2.7 OpenType layout system
Lua module: luaotfload-main 2016/06/16 2.70003 OpenType layout system.
Lua module: lualibs 2016-04-06 2.4 ConTeXt Lua standard libraries.
Lua module: lualibs-extended 2016-04-06 2.4 ConTeXt Lua libraries -- extended co
llection.(using cache: /usr/local/texlive/2016/texmf-var/luatex-cache/generic)
luaotfload | conf : Root cache directory is /usr/local/texlive/2016/texmf-var/lu
atex-cache/generic/names.
luaotfload | init : Loading fontloader “fontloader-2016-06-16.lua” from kpse
-resolved path “/usr/local/texlive/2016/texmf-dist/tex/luatex/luaotfload/fontl
oader-2016-06-16.lua”.
Lua-only attribute luaotfload@state = 1
Lua-only attribute luaotfload@noligature = 2
Lua-only attribute luaotfload@syllabe = 3
luaotfload | init : Context OpenType loader version “3.023”
Inserting `luaotfload.node_processor' at position 1 in `pre_linebreak_filter'.
Inserting `luaotfload.node_processor' at position 1 in `hpack_filter'.
Inserting `luaotfload.define_font' at position 1 in `define_font'.
Lua-only attribute luaotfload_color_attribute = 4
luaotfload | conf : Root cache directory is /usr/local/texlive/2016/texmf-var/lu
atex-cache/generic/names.
Inserting `luaotfload.aux.set_sscale_dimens' at position 1 in `luaotfload.patch_
font'.
Inserting `luaotfload.aux.patch_cambria_domh' at position 2 in `luaotfload.patch
_font'.
Inserting `luaotfload.aux.fixup_fontdata' at position 1 in `luaotfload.patch_fon
t_unsafe'.
Inserting `luaotfload.aux.set_capheight' at position 3 in `luaotfload.patch_font
'.
Inserting `luaotfload.rewrite_fontname' at position 4 in `luaotfload.patch_font'
.
luaotfload | main : initialization completed in 0.181 seconds)
Lua module: fontspec 2016/02/01 2.5a Advanced font selection for LuaLaTeX.
(/usr/local/texlive/2016/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
Package: fontspec-luatex 2016/02/01 v2.5a Font selection for XeLaTeX and LuaLaTe
X
\l_fontspec_script_int=\count115
\l_fontspec_language_int=\count116
\l_fontspec_strnum_int=\count117
\l__fontspec_tmpa_dim=\dimen134
\l__fontspec_tmpb_dim=\dimen135
\l__fontspec_tmpc_dim=\dimen136
\g__file_internal_ior=\read1

(/usr/local/texlive/2016/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2016/06/19 v1.99m Standard LaTeX package

(/usr/local/texlive/2016/texmf-dist/tex/latex/euenc/eu2enc.def
File: eu2enc.def 2010/05/27 v0.1h Experimental Unicode font encodings
)
LaTeX Font Info:    Try loading font information for EU2+lmr on input line 105.

(/usr/local/texlive/2016/texmf-dist/tex/latex/euenc/eu2lmr.fd
File: eu2lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
)
luaotfload | db : Font names database loaded from /usr/local/texlive/2016/texmf-
var/luatex-cache/generic/names/luaotfload-names.luc(load luc: /usr/local/texlive
/2016/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.luc)) (/usr/lo
cal/texlive/2016/texmf-dist/tex/xelatex/xunicode/xunicode.sty
File: xunicode.sty 2011/09/09 v0.981 provides access to latin accents and many o
ther characters in Unicode lower plane

(/usr/local/texlive/2016/texmf-dist/tex/latex/tipa/t3enc.def
File: t3enc.def 2001/12/31 T3 encoding
(load luc: /usr/local/texlive/2016/texmf-var/luatex-cache/generic/fonts/otl/lmro
manslant10-regular.luc)(load luc: /usr/local/texlive/2016/texmf-var/luatex-cache
/generic/fonts/otl/lmroman10-italic.luc)(load luc: /usr/local/texlive/2016/texmf
-var/luatex-cache/generic/fonts/otl/lmroman10-bold.luc)
LaTeX Font Info:    Try loading font information for EU2+lmss on input line 357.


(/usr/local/texlive/2016/texmf-dist/tex/latex/euenc/eu2lmss.fd
File: eu2lmss.fd 2009/10/30 v1.6 Font defs for Latin Modern
)(load luc: /usr/local/texlive/2016/texmf-var/luatex-cache/generic/fonts/otl/lms
ans10-regular.luc))

...snip...

luaotfload | cache : Lookup cache loaded from /usr/local/texlive/2016/texmf-var/
luatex-cache/generic/names/luaotfload-lookup-cache.luc.(load luc: /usr/local/tex
live/2016/texmf-var/luatex-cache/generic/fonts/otl/notosanscham-regular.luc)
luaotfload | aux : font no 21 (<unknown>) defines no feature for script latn
luaotfload | aux : no font with id 21
.................................................
. fontspec info: "no-scripts"
. 
. Font Noto Sans does not contain any OpenType `Script' information.
.................................................
\g__fontspec_family_NotoSans_int=\count123
(load luc: /usr/local/texlive/2016/texmf-var/luatex-cache/generic/fonts/otl/noto
sans-bolditalic.luc)(load luc: /usr/local/texlive/2016/texmf-var/luatex-cache/ge
neric/fonts/otl/notosans-bold.luc)(load luc: /usr/local/texlive/2016/texmf-var/l
uatex-cache/generic/fonts/otl/notosans-italic.luc)
luaotfload | aux : font no 21 (<unknown>) does not define feature smcp for scrip
t  with language 
luaotfload | aux : no font with id 21
luaotfload | aux : font no 23 (<unknown>) does not define feature smcp for scrip
t  with language 
luaotfload | aux : no font with id 23
luaotfload | aux : font no 24 (<unknown>) does not define feature smcp for scrip
t  with language 
luaotfload | aux : no font with id 24
luaotfload | aux : font no 22 (<unknown>) does not define feature smcp for scrip
t  with language 
luaotfload | aux : no font with id 22
.................................................
. fontspec info: "defining-font"
. 
. Font family 'NotoSans(0)' created for font 'Noto Sans' with options
. [Ligatures=TeX].
. 
. This font family consists of the following NFSS series/shapes:
. - 'normal' (m/n) with NFSS spec.: <->"NotoSans:mode=node;+tlig;"
. - 'small caps'  (m/sc) with NFSS spec.: - 'bold' (bx/n) with NFSS spec.:
. <->"NotoSans/B:mode=node;+tlig;"
. - 'bold small caps'  (bx/sc) with NFSS spec.: - 'italic' (m/it) with NFSS
. spec.: <->"NotoSans/I:mode=node;+tlig;"
. - 'italic small caps'  (m/itsc) with NFSS spec.: - 'bold italic' (bx/it)
. with NFSS spec.: <->"NotoSans/BI:mode=node;+tlig;"
. - 'bold italic small caps'  (bx/itsc) with NFSS spec.: 
.................................................
 (./mcve.aux)
\openout1 = mcve.aux

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for EU2/lmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for T3/cmr/m/n on input line 5.
LaTeX Font Info:    Try loading font information for T3+cmr on input line 5.
(/usr/local/texlive/2016/texmf-dist/tex/latex/tipa/t3cmr.fd
File: t3cmr.fd 2001/12/31 TIPA font definitions
)
LaTeX Font Info:    ... okay on input line 5.

...snip...

[1

Missing character: There is no L (U+004C) in font NotoSans:mode=node;+tlig;!
Missing character: There is no o (U+006F) in font NotoSans:mode=node;+tlig;!
Missing character: There is no r (U+0072) in font NotoSans:mode=node;+tlig;!
Missing character: There is no e (U+0065) in font NotoSans:mode=node;+tlig;!
Missing character: There is no m (U+006D) in font NotoSans:mode=node;+tlig;!
Missing character: There is no i (U+0069) in font NotoSans:mode=node;+tlig;!
Missing character: There is no p (U+0070) in font NotoSans:mode=node;+tlig;!
Missing character: There is no s (U+0073) in font NotoSans:mode=node;+tlig;!
Missing character: There is no u (U+0075) in font NotoSans:mode=node;+tlig;!
Missing character: There is no m (U+006D) in font NotoSans:mode=node;+tlig;!
Missing character: There is no d (U+0064) in font NotoSans:mode=node;+tlig;!
Missing character: There is no o (U+006F) in font NotoSans:mode=node;+tlig;!
Missing character: There is no l (U+006C) in font NotoSans:mode=node;+tlig;!
Missing character: There is no o (U+006F) in font NotoSans:mode=node;+tlig;!
Missing character: There is no r (U+0072) in font NotoSans:mode=node;+tlig;!
Missing character: There is no s (U+0073) in font NotoSans:mode=node;+tlig;!
Missing character: There is no i (U+0069) in font NotoSans:mode=node;+tlig;!
Missing character: There is no t (U+0074) in font NotoSans:mode=node;+tlig;!
Missing character: There is no a (U+0061) in font NotoSans:mode=node;+tlig;!
Missing character: There is no m (U+006D) in font NotoSans:mode=node;+tlig;!
Missing character: There is no e (U+0065) in font NotoSans:mode=node;+tlig;!
Missing character: There is no t (U+0074) in font NotoSans:mode=node;+tlig;!
{/usr/local/texlive/2016/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./mcve.aux))

Here is how much of LuaTeX's memory you used:
 14283 strings out of 495118
 100000,319454 words of node,token memory allocated
 396 words of node memory still in use:
   3 hlist, 1 vlist, 1 rule, 7 glue, 4 attribute, 44 glue_spec, 4 attribute_list
, 1 write nodes
   avail lists: 2:13,3:3,4:2,5:10,6:27,7:26,8:1,9:6,11:2
 17598 multiletter control sequences out of 65536+600000
 25 fonts using 2497983 bytes
 50i,4n,62p,343b,231s stack positions out of 5000i,500n,10000p,200000b,100000s
</usr/share/fonts/TTF/NotoSansCham-Regular.ttf>
Output written on mcve.pdf (1 page, 2939 bytes).

PDF statistics: 15 PDF objects out of 1000 (max. 8388607)
 8 compressed objects within 1 object stream
 0 named destinations out of 1000 (max. 131072)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

这是 的内容/usr/local/texlive/2016/texmf-var/luatex-cache/generic/names/luaotfload-lookup-cache.lua。不知何故它决定“Noto Sans”指的是“NotoSansCham-Regular.ttf”。

return {
 ["Noto Sans##655360"]={ "NotoSansCham-Regular.ttf", false },
 ["Noto Sans/B#b##655360"]={ "NotoSans-Bold.ttf", false },
 ["Noto Sans/BI#bi##655360"]={ "NotoSans-BoldItalic.ttf", false },
 ["Noto Sans/I#i##655360"]={ "NotoSans-Italic.ttf", false },
 ["NotoSans##655360"]={ "NotoSansCham-Regular.ttf", false },
 ["NotoSans/B#b##655360"]={ "NotoSans-Bold.ttf", false },
 ["NotoSans/BI#bi##655360"]={ "NotoSans-BoldItalic.ttf", false },
 ["NotoSans/I#i##655360"]={ "NotoSans-Italic.ttf", false },
 ["NotoSans:mode=node;+tlig;##655360"]={ "NotoSansCham-Regular.ttf", false },
}

相关内容