以下是 MWE:
\documentclass{standalone}
\usepackage[default]{lato}
\begin{document}
Hello World
\end{document}
当使用 xelatex 编译时,它会生成以下文档:
很明显,它不是 lato 字体。
仅供参考,以下是日志文件中的相关行(至少我是这样认为的:):
(/home/user/texlive/2017/texmf-dist/tex/latex/lato/lato.sty
Package: lato 2011/08/06 Lato
(/home/user/texlive/2017/texmf-dist/tex/latex/slantsc/slantsc.sty
Package: slantsc 2012/01/01 v2.11 Provide Slanted an Italic Small Caps
(/home/user/texlive/2017/texmf-dist/tex/latex/base/ifthen.sty
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
LaTeX Info: Redefining \upshape on input line 35.
LaTeX Info: Redefining \slshape on input line 45.
LaTeX Info: Redefining \itshape on input line 55.
LaTeX Info: Redefining \scshape on input line 65.
)) (/tmp/1.aux)
\openout1 = `1.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Try loading font information for TU+fla on input line 3.
LaTeX Font Info: No file TUfla.fd. on input line 3.
LaTeX Font Warning: Font shape `TU/fla/m/n' undefined
(Font) using `TU/lmr/m/n' instead on input line 3.
[1
] (/tmp/1.aux)
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
这是怎么回事?为什么在有 Lato 可用的情况下要替换字体?这与字体编码有关吗?我害怕这个词!或者与 T1、OTF、TTF 等有关。我也不明白这些。或者 sffamily 等?我该如何纠正这个问题?
答案1
答案2
是的,这是关于 fontencoding 和 T1 的。:-) 那应该可行:
\documentclass{standalone}
\usepackage[default]{lato}
\usepackage[T1]{fontenc}
\begin{document}
Hello World
\end{document}