如何使用 Erewhon 制作粗体小型大写字母?
\documentclass{article}
\RequirePackage{fontspec}
\setmainfont{Erewhon}[
Extension=.otf,
UprightFont=*-Regular,
ItalicFont=*-Italic,
BoldFont=*-Bold,
BoldItalicFont=*-BoldItalic,
SlantedFont=*-RegularSlanted,
BoldSlantedFont=*-BoldSlanted,
SmallCapsFont=*-SmallCaps,
SmallCapsFont=*-Regular,
SmallCapsFeatures={Letters=SmallCaps}
]
\setsansfont{texgyreheros}[
Scale=MatchLowercase,% or MatchUppercase
Extension=.otf,
UprightFont=*-regular,
ItalicFont=*-italic,
BoldFont=*-bold,
BoldItalicFont=*-bolditalic,
]
\begin{document}
\textbf{Exercice}
\textbf{\textsc{Exercice}}
\textsc{\textbf{Exercice}}
\textsc{Exercice}
\end{document}
答案1
您有两个错误。首先,Erewhon-SmallCaps.otf
不存在;其次,您声明小写字母必须使用Erewhon-Regular.otf
。
在日志文件中你发现
.................................................
. fontspec info: "defining-font"
.
. Font family 'Erewhon(0)' created for font 'Erewhon' with options
. [Ligatures=TeX,Extension=.otf,UprightFont=*-Regular,ItalicFont=*-Italic,BoldF
ont=*-Bold,BoldItalicFont=*-BoldItalic,SlantedFont=*-RegularSlanted,BoldSlanted
Font=*-BoldSlanted,SmallCapsFont=*-SmallCaps,SmallCapsFont=*-Regular,SmallCapsF
eatures={Letters=SmallCaps}].
.
. This font family consists of the following NFSS series/shapes:
. - 'normal' (m/n) with NFSS spec.:
. <->"[Erewhon-Regular.otf]/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'small caps' (m/sc) with NFSS spec.:
. <->"[Erewhon-Regular.otf]/OT:script=latn;language=DFLT;mapping=tex-text;+smcp
;"-
. 'bold' (bx/n) with NFSS spec.:
. <->"[Erewhon-Bold.otf]/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold small caps' (bx/sc) with NFSS spec.:
. <->"[Erewhon-Regular.otf]/OT:script=latn;language=DFLT;mapping=tex-text;+smcp
;"-
. 'italic' (m/it) with NFSS spec.:
. <->"[Erewhon-Italic.otf]/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'italic small caps' (m/itsc) with NFSS spec.:
. <->"[Erewhon-Regular.otf]/OT:script=latn;language=DFLT;mapping=tex-text;+smcp
;"-
. 'slanted' (m/sl) with NFSS spec.:
. <->"[Erewhon-RegularSlanted.otf]/OT:script=latn;language=DFLT;mapping=tex-tex
t;"
. - 'slanted small caps' (m/slsc) with NFSS spec.:
. <->"[Erewhon-Regular.otf]/OT:script=latn;language=DFLT;mapping=tex-text;+smcp
;"-
. 'bold italic' (bx/it) with NFSS spec.:
. <->"[Erewhon-BoldItalic.otf]/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold italic small caps' (bx/itsc) with NFSS spec.:
. <->"[Erewhon-Regular.otf]/OT:script=latn;language=DFLT;mapping=tex-text;+smcp
;"-
. 'bold slanted' (bx/sl) with NFSS spec.:
. <->"[Erewhon-BoldSlanted.otf]/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold slanted small caps' (bx/slsc) with NFSS spec.:
. <->"[Erewhon-Regular.otf]/OT:script=latn;language=DFLT;mapping=tex-text;+smcp
;"
.................................................
并且您可以清楚地看到小型大写字母总是映射到Erewhon-Regular.otf
。
通过删除SmallCaps...
线条,我们得到
.................................................
. fontspec info: "defining-font"
.
. Font family 'Erewhon(0)' created for font 'Erewhon' with options
. [Ligatures=TeX,Extension=.otf,UprightFont=*-Regular,ItalicFont=*-Italic,BoldF
ont=*-Bold,BoldItalicFont=*-BoldItalic,SlantedFont=*-RegularSlanted,BoldSlanted
Font=*-BoldSlanted].
.
. This font family consists of the following NFSS series/shapes:
. - 'normal' (m/n) with NFSS spec.:
. <->"[Erewhon-Regular.otf]/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'small caps' (m/sc) with NFSS spec.:
. <->"[Erewhon-Regular.otf]/OT:script=latn;language=DFLT;mapping=tex-text;+smcp
;"-
. 'bold' (bx/n) with NFSS spec.:
. <->"[Erewhon-Bold.otf]/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold small caps' (bx/sc) with NFSS spec.:
. <->"[Erewhon-Bold.otf]/OT:script=latn;language=DFLT;mapping=tex-text;+smcp;"-
. 'italic' (m/it) with NFSS spec.:
. <->"[Erewhon-Italic.otf]/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'italic small caps' (m/itsc) with NFSS spec.:
. <->"[Erewhon-Italic.otf]/OT:script=latn;language=DFLT;mapping=tex-text;+smcp;
"-
. 'slanted' (m/sl) with NFSS spec.:
. <->"[Erewhon-RegularSlanted.otf]/OT:script=latn;language=DFLT;mapping=tex-tex
t;"
. - 'slanted small caps' (m/slsc) with NFSS spec.:
. <->"[Erewhon-RegularSlanted.otf]/OT:script=latn;language=DFLT;mapping=tex-tex
t;+smcp;"-
. 'bold italic' (bx/it) with NFSS spec.:
. <->"[Erewhon-BoldItalic.otf]/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold italic small caps' (bx/itsc) with NFSS spec.:
. <->"[Erewhon-BoldItalic.otf]/OT:script=latn;language=DFLT;mapping=tex-text;+s
mcp;"-
. 'bold slanted' (bx/sl) with NFSS spec.:
. <->"[Erewhon-BoldSlanted.otf]/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold slanted small caps' (bx/slsc) with NFSS spec.:
. <->"[Erewhon-BoldSlanted.otf]/OT:script=latn;language=DFLT;mapping=tex-text;+
smcp;"
.................................................
一切正常:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Erewhon}[
Extension=.otf,
UprightFont=*-Regular,
ItalicFont=*-Italic,
BoldFont=*-Bold,
BoldItalicFont=*-BoldItalic,
SlantedFont=*-RegularSlanted,
BoldSlantedFont=*-BoldSlanted,
]
\begin{document}
\textbf{Exercice}
\textbf{\textsc{Exercice}}
\textsc{\textbf{Exercice}}
\textsc{Exercice}
\end{document}