我有一个小小的需求,就是使用斜体小写字母,但我的字体没有。所以我用了 fakeslant。下面的代码适用于 lualatex,但我收到了以下警告消息:
LaTeX Font Warning: Font shape `TU/SourceSerifPro(0)/m/scit' undefined
(Font) using `TU/SourceSerifPro(0)/m/scsl' instead on input line 1
我能做些什么来消除警告?
\documentclass{article}
\usepackage{fontspec}
\setmainfont
[ UprightFont = *-Regular ,
ItalicFont = *-Italic ,
BoldFont = *-Semibold ,
BoldItalicFont = *-SemiboldIt ,
SlantedFont = SourceSerifPro-Regular,
SlantedFeatures = {FakeSlant=0.2},
]
{Source Serif Pro}
\begin{document}
\emph{\textsc{Hello}}
\end{document}
答案1
您可以忽略该警告(这是无害的),或者使用\textsl
and\slshape
代替\textit
and \itshape
。或者您可以将倾斜小型大写字体设置为斜体小型大写字体:
\documentclass{article}
\usepackage{fontspec}
\setmainfont
[ UprightFont = *-Regular ,
ItalicFont = *-Italic ,
BoldFont = *-Semibold ,
BoldItalicFont = *-SemiboldIt ,
SlantedFont = SourceSerifPro-Regular,
SlantedFeatures = {FakeSlant=0.2},
ItalicFeatures = { SmallCapsFont = SourceSerifPro-Regular,
SmallCapsFeatures={Letters=SmallCaps, FakeSlant=0.2} }
]
{Source Serif Pro}
\begin{document}
\emph{\textsc{Hello}}
\end{document}