我知道这个论坛上有类似的帖子。但任何回复都与我的问题有关。
我正在使用 Ubuntu 10.4,在决定使用 XeLaTeX 而不是 LaTeX 之前,我没有遇到字体问题(参见https://tex.stackexchange.com/questions/12347/typesetting-a-document-using-arabic-script/12358#12358)。问题是我无法使用 XeLaTeX 编译任何 .tex 文档,也无法正确显示 XeLaTeX 文档。正如我从上述帖子中了解到的那样,XeLaTeX 使用系统中通常可用的字体。
我尝试阅读fontspec
文档,但它以 pdf 格式打开时有很多空白,并且终端输出(相当长)大部分都是错误。这只是其中的几行:
Error: Missing language pack for 'Adobe-Japan1' mapping
Error: Unknown font tag 'F5.1'
Error (24124): No font in show
Error: Unknown font tag 'F5.1'
我正在尝试编译简单的 XeLaTeX 文件:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\begin{document}
Hello World!
\end{document}
没有成功。这是编译的终端输出:
This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian)
restricted \write18 enabled.
entering extended mode
(./ex.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, polish, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf-texlive/tex/xelatex/fontspec/fontspec.sty
(/usr/share/texmf-texlive/tex/generic/ifxetex/ifxetex.sty)
(/usr/share/texmf-texlive/tex/latex/tools/calc.sty)
(/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texmf-texlive/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texmf-texlive/tex/generic/xkeyval/keyval.tex)))
(/usr/share/texmf-texlive/tex/latex/base/fontenc.sty
(/usr/share/texmf-texlive/tex/xelatex/euenc/eu1enc.def)
(/usr/share/texmf-texlive/tex/xelatex/euenc/eu1lmr.fd))
fontspec.cfg loaded.
(/usr/share/texmf-texlive/tex/xelatex/fontspec/fontspec.cfg))kpathsea: Invalid fontname `Linux Libertine O', contains ' '
! Font \zf@basefont="Linux Libertine O" at 10.0pt not loadable: Metric (TFM) fi
le or installed font not found.
\zf@fontspec ...ntname \zf@suffix " at \f@size pt
\unless \ifzf@icu \zf@set@...
l.3 \setmainfont{Linux Libertine O}
?
我找不到Linux Libertine O
。搜索otf-
给出aptitude
的结果如下:
maria@maria-laptop:/etc/fonts$ aptitude search otf
p emdebian-rootfs - emdebian root filesystem support
p libotf-bin - A Library for handling OpenType Font - utilities
p libotf-dev - A Library for handling OpenType Font - development
i libotf0 - A Library for handling OpenType Font - runtime
p libotf0-dbg - The libotf libraries and debugging symbols
p libpam-dotfile - A PAM module which allows users to have more than one password
p livecd-rootfs - construction script for the livecd rootfs
p makebootfat - Utility to create a bootable FAT filesystem
p otf-ipaexfont - Japanese OpenType font, IPAexFont (IPAexGothic/Mincho)
p otf-ipaexfont-gothic - Japanese OpenType font, IPAexFont (IPAexGothic)
p otf-ipaexfont-mincho - Japanese OpenType font, IPAexFont (IPAexMincho)
p otf-ipafont - Japanese OpenType font set, IPAfont
p otf-ipafont-gothic - Japanese OpenType font set, IPA Gothic font
p otf-ipafont-mincho - Japanese OpenType font set, IPA Mincho font
p otf-stix - the Scientific and Technical Information eXchange fonts
p otf-thai-tlwg - Thai fonts in OpenType format
p otf-yozvox-yozfont - Japanese proportional Handwriting OpenType font
p otf2bdf - generate BDF bitmap fonts from OpenType outline fonts
p robotfindskitten - Zen Simulation of robot finding kitten
因此,如果我没记错的话,有问题的字体不只是被卸载,而且不可用。这是否意味着我缺少一些存储库?
我也尝试从线程中应用解决方案如何重新安装默认字体?,但结果是:
maria@maria-laptop:~$ sudo apt-get install msttcorefonts
[sudo] password for maria:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting ttf-mscorefonts-installer instead of msttcorefonts
ttf-mscorefonts-installer is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
maria@maria-laptop:~$
这似乎不是使用 XeLaTeX 的常见问题;提到的帖子中没有人建议安装 TeX Live 以外的任何其他东西。
提前致谢
答案1
最后我终于解决了这个问题。
缺少的字体可以通过 Ubuntu 软件中心访问(我之前以为它只是与
apt
Synaptic 相同机制的另一种图形表示……)通过安装解决了文档问题
poppler-data
。
希望它对遇到类似问题的人有所帮助。