EB-Garamond
字体在我的操作系统中。
fc-list | grep EB
/usr/share/fonts/eb-garamond/static/EBGaramond-Medium.ttf: EB Garamond,EB Garamond Medium:style=Medium,Regular
/usr/share/fonts/eb-garamond/static/EBGaramond-Regular.ttf: EB Garamond:style=Regular
为了简单起见,输出中省略了许多行。
编辑
test.tex
。
vim test.tex
\documentclass{article}
\usepackage{fontspec}
\setmainfont{EB Garamond}
\begin{document}
Abc def ghi \textit{abc def ghi}
\end{document}
编译:
xelatex test.tex
This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022/Debian) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-01-16>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-xetex.def)))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
No file test.aux.
(/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd) [1] (./test.aux)
xdvipdfmx:fatal: Invalid font: -1 (0)
No output PDF file written.
)
Error 256 (driver return code) generating output;
file test.pdf may not be valid.
Transcript written on test.log.
更多步骤:
xelatex --no-pdf test.tex
#completed fine with no errors
xdvipdfmx -vv test.xdv
<FONTMAP:/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map><FONTMAP:/var/lib/texmf/fonts/map/dvipdfmx/updmap/kanjix.map><FONTMAP:/usr/share/texlive/texmf-dist/fonts/map/dvipdfmx/ckx.map>DVI Comment: XeTeX output 2024.10.08:1033
test.xdv -> test.pdf
<AGL:texglyphlist.txt><AGL:pdfglyphlist.txt><AGL:glyphlist.txt>[1</usr/share/fonts/eb-garamond/[email protected]<NATIVE-FONTMAP:/usr/share/fonts/eb-garamond/EBGaramond-VariableFont_wght.ttf/327680/H/65536/0/0>
fontmap: /usr/share/fonts/eb-garamond/EBGaramond-VariableFont_wght.ttf/327680/H/65536/0/0 -> /usr/share/fonts/eb-garamond/EBGaramond-VariableFont_wght.ttf(Identity-H)[index:327680]
xdvipdfmx:warning: Invalid TTC index (not TTC font): /usr/share/fonts/eb-garamond/EBGaramond-VariableFont_wght.ttf
>
xdvipdfmx:fatal: Invalid font: -1 (0)
No output PDF file written.
如何解决?
用lualatex命令解决:
lualatex test.tex