我正在使用带有 metropolis 的 beamer 制作演示文稿。我安装了 Fira 字体系列,一切似乎都正常(我可以在其他程序中使用它)。但是,每次我尝试编译演示文稿时,xelatex 都会中止并显示错误消息:
xdvipdfmx:fatal: Cannot proceed without the font: /usr/share/fonts/truetype/FiraSans/Normal/Roman/FiraSans-Regular.woff
字体存在于此路径中,并且由 fc-list 列出,因此对我来说似乎很神秘。我认为这是我的 texLive 安装或我安装 Fira 字体的方式所特有的,因为它是在 Windows 上编译的(我使用的是 Ubuntu)。演示没有什么特别之处,以下 MWE 重现了此错误:
\documentclass[]{beamer}
\usetheme[numbering=none,sectionpage=none,subsectionpage=none,block=fill]{metropolis}
\setsansfont[BoldFont={Fira Sans}]{Fira Sans Light}
\setmonofont{Fira Mono}
\title{This is the title}
\subtitle{with subtitle}
\date{Feb 2018}
\author{author}
\institute{institution}
\begin{document}
\maketitle
\begin{frame}[fragile]
\frametitle{the title}
\begin{center}
This is the text
\end{center}
\end{frame}
\end{document}
有人有什么主意吗?
更新:添加 mwe.log 的相关部分
\c@fontsnotfound=\count326
\g__fontspec_family_FiraSansLight_int=\count327
.................................................
. fontspec info: "defining-font"
.
. Font family 'FiraSansLight(0)' created for font 'Fira Sans Light' with
. options [Ligatures=TeX,ItalicFont={Fira Sans Light Italic},BoldFont={Fira
. Sans},BoldItalicFont={Fira Sans Italic}].
.
. This font family consists of the following NFSS series/shapes:
.
. - 'normal' (m/n) with NFSS spec.: <->"Fira Sans
. Light/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'small caps' (m/sc) with NFSS spec.: <->"Fira Sans
. Light/OT:script=latn;language=DFLT;+smcp;mapping=tex-text;"
. - 'bold' (bx/n) with NFSS spec.: <->"Fira
. Sans/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold small caps' (bx/sc) with NFSS spec.: <->"Fira
. Sans/OT:script=latn;language=DFLT;+smcp;mapping=tex-text;"
. - 'italic' (m/it) with NFSS spec.: <->"Fira Sans Light
. Italic/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'italic small caps' (m/itsc) with NFSS spec.: <->"Fira Sans Light
. Italic/OT:script=latn;language=DFLT;+smcp;mapping=tex-text;"
. - 'bold italic' (bx/it) with NFSS spec.: <->"Fira Sans
. Italic/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold italic small caps' (bx/itsc) with NFSS spec.: <->"Fira Sans
. Italic/OT:script=latn;language=DFLT;+smcp;mapping=tex-text;"
.................................................
LaTeX Info: Redefining \sffamily on input line 95.
*************************************************
* fontspec warning: "only-xetex-feature"
*
* Ignored XeTeX only feature: 'HyphenChar'.
*************************************************
\g__fontspec_family_FiraMono_int=\count328
.................................................
. fontspec info: "no-font-shape"
.
. Could not resolve font "Fira Mono Medium/I" (it probably doesn't exist).
.................................................
.................................................
. fontspec info: "no-font-shape"
.
. Could not resolve font "Fira Mono/I" (it probably doesn't exist).
.................................................
*************************************************
* fontspec warning: "only-xetex-feature"
*
* Ignored XeTeX only feature: 'HyphenChar'.
*************************************************
*************************************************
* fontspec warning: "only-xetex-feature"
*
* Ignored XeTeX only feature: 'HyphenChar'.
*************************************************
*************************************************
* fontspec warning: "only-xetex-feature"
*
* Ignored XeTeX only feature: 'HyphenChar'.
*************************************************
.................................................
. fontspec info: "defining-font"
.
. Font family 'FiraMono(0)' created for font 'Fira Mono' with options
. [WordSpace={1,0,0},HyphenChar=None,PunctuationSpace=WordSpace,BoldFont={Fira
. Mono Medium}].
.
. This font family consists of the following NFSS series/shapes:
.
. - 'normal' (m/n) with NFSS spec.: <->"Fira
. Mono/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
. \hyphenchar \font =-1\relax
. - 'bold' (bx/n) with NFSS spec.: <->"Fira Mono
. Medium/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
. \hyphenchar \font =-1\relax
. - 'bold italic' (bx/it) with NFSS spec.: <->"Fira
. Mono/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
. \hyphenchar \font =-1\relax
.................................................
LaTeX Info: Redefining \ttfamily on input line 95.
))
.................................................
. fontspec info: "defining-font"
.
. Font family 'FiraSansLight(1)' created for font 'Fira Sans Light' with
. options [Ligatures=TeX,BoldFont={Fira Sans}].
.
. This font family consists of the following NFSS series/shapes:
.
. - 'normal' (m/n) with NFSS spec.: <->"Fira Sans
. Light/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'small caps' (m/sc) with NFSS spec.: <->"Fira Sans
. Light/OT:script=latn;language=DFLT;+smcp;mapping=tex-text;"
. - 'bold' (bx/n) with NFSS spec.: <->"Fira
. Sans/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold small caps' (bx/sc) with NFSS spec.: <->"Fira
. Sans/OT:script=latn;language=DFLT;+smcp;mapping=tex-text;"
. - 'italic' (m/it) with NFSS spec.: <->"Fira Sans
. Light/I/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'italic small caps' (m/itsc) with NFSS spec.: <->"Fira Sans
. Light/I/OT:script=latn;language=DFLT;+smcp;mapping=tex-text;"
. - 'bold italic' (bx/it) with NFSS spec.: <->"Fira
. Sans/I/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold italic small caps' (bx/itsc) with NFSS spec.: <->"Fira
. Sans/I/OT:script=latn;language=DFLT;+smcp;mapping=tex-text;"
.................................................
LaTeX Info: Redefining \sffamily on input line 6.
*************************************************
* fontspec warning: "only-xetex-feature"
*
* Ignored XeTeX only feature: 'HyphenChar'.
*************************************************
.................................................
. fontspec info: "no-font-shape"
.
. Could not resolve font "Fira Mono/I" (it probably doesn't exist).
.................................................
*************************************************
* fontspec warning: "only-xetex-feature"
*
* Ignored XeTeX only feature: 'HyphenChar'.
*************************************************
*************************************************
* fontspec warning: "only-xetex-feature"
*
* Ignored XeTeX only feature: 'HyphenChar'.
*************************************************
*************************************************
* fontspec warning: "only-xetex-feature"
*
* Ignored XeTeX only feature: 'HyphenChar'.
*************************************************
.................................................
. fontspec info: "defining-font"
.
. Font family 'FiraMono(1)' created for font 'Fira Mono' with options
. [WordSpace={1,0,0},HyphenChar=None,PunctuationSpace=WordSpace].
.
. This font family consists of the following NFSS series/shapes:
.
. - 'normal' (m/n) with NFSS spec.: <->"Fira
. Mono/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
. \hyphenchar \font =-1\relax
. - 'bold' (bx/n) with NFSS spec.: <->"Fira
. Mono/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
. \hyphenchar \font =-1\relax
. - 'bold italic' (bx/it) with NFSS spec.: <->"Fira
. Mono/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
. \hyphenchar \font =-1\relax
.................................................
LaTeX Info: Redefining \ttfamily on input line 7.
(./mwe.aux)
\openout1 = `mwe.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 17.
LaTeX Font Info: ... okay on input line 17.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 17.
LaTeX Font Info: ... okay on input line 17.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 17.
LaTeX Font Info: ... okay on input line 17.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 17.
LaTeX Font Info: ... okay on input line 17.
LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 17.
LaTeX Font Info: ... okay on input line 17.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 17.
LaTeX Font Info: ... okay on input line 17.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 17.
LaTeX Font Info: ... okay on input line 17.
LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 17.
LaTeX Font Info: ... okay on input line 17.
LaTeX Font Info: Checking defaults for PU/pdf/m/n on input line 17.
LaTeX Font Info: ... okay on input line 17.
*geometry* driver: auto-detecting
*geometry* detected driver: xetex
*geometry* verbose mode - [ preamble ] result:
* driver: xetex
* paper: custom
* layout: <same size as paper>
* layoutoffset:(h,v)=(0.0pt,0.0pt)
* modes: includehead includefoot
* h-part:(L,W,R)=(28.45274pt, 307.28987pt, 28.45274pt)
* v-part:(T,H,B)=(0.0pt, 273.14662pt, 0.0pt)
* \paperwidth=364.19536pt
* \paperheight=273.14662pt
* \textwidth=307.28987pt
* \textheight=244.6939pt
* \oddsidemargin=-43.81725pt
* \evensidemargin=-43.81725pt
* \topmargin=-72.26999pt
* \headheight=14.22636pt
* \headsep=0.0pt
* \topskip=11.0pt
* \footskip=14.22636pt
* \marginparwidth=4.0pt
* \marginparsep=10.0pt
* \columnsep=10.0pt
* \skip\footins=10.0pt plus 4.0pt minus 2.0pt
* \hoffset=0.0pt
* \voffset=0.0pt
* \mag=1000
* \@twocolumnfalse
* \@twosidefalse
* \@mparswitchfalse
* \@reversemarginfalse
* (1in=72.27pt=25.4mm, 1cm=28.453pt)
ABD: EveryShipout initializing macros
\AtBeginShipoutBox=\box75
Package hyperref Info: Link coloring OFF on input line 17.
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty
Package: nameref 2016/05/21 v2.44 Cross-referencing by name of section
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty
Package: gettitlestring 2016/05/16 v1.5 Cleanup title references (HO)
)
\c@section@level=\count329
)
LaTeX Info: Redefining \ref on input line 17.
LaTeX Info: Redefining \pageref on input line 17.
LaTeX Info: Redefining \nameref on input line 17.
(./mwe.out) (./mwe.out)
\@outlinefile=\write5
\openout5 = `mwe.out'.
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) OT1/cmr/m/n --> OT1/cmss/m/n on input line 17.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) OT1/cmr/bx/n --> OT1/cmss/bx/n on input line 17.
\symnumbers=\mathgroup6
\sympureletters=\mathgroup7
LaTeX Font Info: Overwriting math alphabet `\mathrm' in version `normal'
(Font) OT1/cmss/m/n --> TU/lmr/m/n on input line 17.
LaTeX Font Info: Redeclaring math alphabet \mathbf on input line 17.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal'
(Font) OT1/cmr/bx/n --> TU/FiraSansLight(1)/bx/n on input line
17.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold'
(Font) OT1/cmr/bx/n --> TU/FiraSansLight(1)/bx/n on input line
17.
LaTeX Font Info: Redeclaring math alphabet \mathsf on input line 17.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal'
(Font) OT1/cmss/m/n --> TU/FiraSansLight(1)/m/n on input line
17.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
(Font) OT1/cmss/bx/n --> TU/FiraSansLight(1)/m/n on input line
17.
LaTeX Font Info: Redeclaring math alphabet \mathit on input line 17.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal'
(Font) OT1/cmr/m/it --> TU/FiraSansLight(1)/m/it on input line
17.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
(Font) OT1/cmr/bx/it --> TU/FiraSansLight(1)/m/it on input lin
e 17.
LaTeX Font Info: Redeclaring math alphabet \mathtt on input line 17.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal'
(Font) OT1/cmtt/m/n --> TU/FiraMono(1)/m/n on input line 17.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
(Font) OT1/cmtt/m/n --> TU/FiraMono(1)/m/n on input line 17.
LaTeX Font Info: Overwriting symbol font `numbers' in version `bold'
(Font) TU/FiraSansLight(1)/m/n --> TU/FiraSansLight(1)/bx/n on
input line 17.
LaTeX Font Info: Overwriting symbol font `pureletters' in version `bold'
(Font) TU/FiraSansLight(1)/m/it --> TU/FiraSansLight(1)/bx/it
on input line 17.
LaTeX Font Info: Overwriting math alphabet `\mathrm' in version `bold'
(Font) OT1/cmss/bx/n --> TU/lmr/bx/n on input line 17.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold'
(Font) TU/FiraSansLight(1)/bx/n --> TU/FiraSansLight(1)/bx/n o
n input line 17.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
(Font) TU/FiraSansLight(1)/m/n --> TU/FiraSansLight(1)/bx/n on
input line 17.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
(Font) TU/FiraSansLight(1)/m/it --> TU/FiraSansLight(1)/bx/it
on input line 17.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
(Font) TU/FiraMono(1)/m/n --> TU/FiraMono(1)/bx/n on input lin
e 17.
答案1
我在这里发布了答案,但大部分答案来自如何设置字体 Scheherazade 以用于 XeLaTeX?
我只是替换了
\setsansfont[BoldFont={Fira Sans}]{Fira Sans Light}
\setmonofont{Fira Mono}
经过
\setsansfont[BoldFont={FiraSans-Bold.ttf}]{FiraSans-Light.ttf}
\setmonofont{FiraMono-Regular.ttf}
强制 xelatex 使用这些字体而不是在与我提供的名称匹配的路径中找到的任何字体。
答案2
我下载了Fira Sans并提取字体子/usr/share/fonts
文件夹,如下所示:
unzip Fira_Sans.zip -d /usr/share/fonts/truetype/Fira_Sans/