是否可以在 XeLaTeX 中将 comfortaa 字体仅用于文档的选定部分?我经验不足,不清楚字体如何工作,目前只能让它用于整个文档或不用于任何部分。
答案1
您可以从样式中复制设置:
\documentclass{article}
\usepackage{fontspec}
\newfontfamily\comfortaa{Comfortaa}[
Extension=.ttf,%
Ligatures={TeX,Common},%
FontFace={l}{n}{*-Light},%
FontFace={l}{it}{Font=*-Light,FakeSlant=0.167},%
UprightFont={*-Regular},%
ItalicFont={*-Regular},%
ItalicFeatures={FakeSlant=0.167},%
FontFace={b}{n}{*-Bold},%
FontFace={b}{it}{Font=*-Bold,FakeSlant=0.167},%
BoldFont={*-Bold},%
BoldItalicFont={*-Bold},%
BoldItalicFeatures={FakeSlant=0.167}]
\begin{document}
Some normal text, \textit{italic} and \textbf{bold}.
{\comfortaa Some text in Comfortaa, \textit{italic} and \textbf{bold}.}
Some normal text, \textit{italic} and \textbf{bold}.
\end{document}