使用 fakeslant 代替小號大寫斜體時抑制警告

使用 fakeslant 代替小號大寫斜體時抑制警告

我有一個小需要使用斜體小型大寫字母,但我的字體缺少它們。所以我用的是 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

您可以忽略該警告(這是無害的),或使用\textsland\slshape代替\textitand \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}

來源 Serif Pro 範例

相關內容