我想使用带衬线数字的小型大写字体。为此,我设置了SmallCapsFeatures = { Numbers = Lining }
。但是,这样,字母就不再是小型大写字母了。有没有办法设置数字的样式而不影响字母?
下面是 MWE。
\documentclass{article}
\usepackage{fontspec}
\setsansfont{SourceSansPro-Regular.otf}
[
Scale = MatchLowercase ,
BoldFont = SourceSansPro-Bold.otf ,
ItalicFont = SourceSansPro-RegularIt.otf ,
BoldItalicFont = SourceSansPro-BoldIt.otf ,
SmallCapsFeatures = { Numbers = Lining } ,
BoldFeatures = {
SmallCapsFeatures = { Numbers = Lining } ,
}
]
\usepackage{blindtext}
\begin{document}
\sffamily
{\scshape A0b1c2d3}
{\bfseries\scshape A0b1c2d3}
{\bfseries A0b1c2d3}
\end{document}
答案1
简短答案
SmallCapsFeatures = { Numbers=Lining, Letters=SmallCaps }
较长的答案
默认情况下,SmallCapsFeatures
激活Letters=SmallCaps
(该smcp
功能)。SmallCapsFeatures=
手动设置可覆盖该功能。您需要同时启用两者。
\documentclass{article}
\usepackage{fontspec}
\setsansfont{SourceSansPro-Regular.otf}
[
Scale = MatchLowercase ,
BoldFont = SourceSansPro-Bold.otf ,
ItalicFont = SourceSansPro-RegularIt.otf ,
BoldItalicFont = SourceSansPro-BoldIt.otf ,
SmallCapsFeatures = { Numbers = Lining, Letters=SmallCaps } ,
BoldFeatures = {
SmallCapsFeatures = { Numbers = Lining, Letters=SmallCaps } ,
}
]
\usepackage{blindtext}
\begin{document}
\sffamily
{\scshape A0b1c2d3}
{\bfseries\scshape A0b1c2d3}
{\bfseries A0b1c2d3}
\end{document}
答案2
以下示例对我有用,可生成 SmallCaps 和内衬数字。正如 Thérèse 所说,它们是默认使用的。
\documentclass{article}
\usepackage{fontspec}
\setsansfont{SourceSans3-Regular.otf}
[ Scale = MatchLowercase ,
BoldFont = SourceSans3-Bold.otf ,
ItalicFont = SourceSans3-It.otf ,
BoldItalicFont = SourceSans3-BoldIt.otf ,
]
\begin{document}
\sffamily
{\noindent\scshape Regular SmallCaps \quad A0b1c2d3 } \newline
{\bfseries\scshape Bold SmallCaps \quad A0b1c2d3}\newline
{\bfseries Bold No Caps \quad A0b1c2d3}
\end{document}