使用 xelatex 作为编译器时,fontspec 会发出有关字体的警告

使用 xelatex 作为编译器时,fontspec 会发出有关字体的警告

我在序言中使用了以下内容:\usepackage[times]{fontsetup}。文档是用 xelatex 编译的。一切顺利,但我担心警告:

Package fontspec Warning: Font "FreeSerifbItalic" does not contain requested
(fontspec)                Script "Math".


Package fontspec Warning: OpenType feature 'Style=MathScript' (ssty) not
(fontspec)                available for font 'FreeSerifbItalic' with script
(fontspec)                'CustomDefault' and language 'Default'.


Package fontspec Warning: OpenType feature 'Style=MathScriptScript' (ssty) not
(fontspec)                available for font 'FreeSerifbItalic' with script
(fontspec)                'CustomDefault' and language 'Default'.

...

Package fontspec Warning: Font "FreeSerifbBoldItalic" does not contain
(fontspec)                requested Script "Math".


Package fontspec Warning: OpenType feature 'Style=MathScript' (ssty) not
(fontspec)                available for font 'FreeSerifbBoldItalic' with
(fontspec)                script 'CustomDefault' and language 'Default'.


Package fontspec Warning: OpenType feature 'Style=MathScriptScript' (ssty) not
(fontspec)                available for font 'FreeSerifbBoldItalic' with
(fontspec)                script 'CustomDefault' and language 'Default'.

有点担心?我该如何消除这些警告?

答案1

times选项传递给时fontsetup,子包fsptimesot被加载,这样做(重新格式化以便于阅读)

\setmainfont{FreeSerifb.otf}[
  ItalicFont=FreeSerifbItalic.otf,
  BoldFont=FreeSerifbBold.otf,
  BoldItalicFont=FreeSerifbBoldItalic.otf,
  SmallCapsFont=FreeSerifb-SmallCapsAlt.otf
]

\setmathfont{STIXTwoMath-Regular.otf}
\setmathfont{FreeSerifb.otf}[
  range=\mathup/{num,latin,Latin,greek,Greek}
]
\setmathfont{FreeSerifbBold.otf}[
  range=\mathbfup/{num,latin,Latin,greek,Greek}
]
\setmathfont{FreeSerifbBoldItalic.otf}[
  range=\mathit/{num,latin,Latin,greek,Greek}
]
\setmathfont{FreeSerifbItalic.otf}[
  range=\mathbfit/{num,latin,Latin,greek,Greek}
]

由于FreeSerifb*字体没有 MATH 表,所以您会收到这些警告。其实没什么可担心的。将来这种情况可能会改变(这些字体是由 的同一作者制作的fontsetup)。

相关内容