使用时libertinus
字体并使用 进行编译xelatex
,选择 sans italic 字体\textit
会导致加载粗体斜体字体。为什么?
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Libertinus Sans}
\begin{document}
Test
\textbf{Test}
\textit{Test}
\end{document}
Libertinus Sans Italic
文件夹中有一个字体叫什么libertinus
,按照文件来看好像是可以找到的.log
:
.................................................
. fontspec info: "defining-font"
.
. Font family 'LibertinusSans(0)' created for font 'Libertinus Sans' with
. options [Ligatures=TeX].
.
. This font family consists of the following NFSS series/shapes:
.
. - 'normal' (m/n) with NFSS spec.: <->"Libertinus
. Sans/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'small caps' (m/sc) with NFSS spec.: <->"Libertinus
. Sans/OT:script=latn;language=DFLT;+smcp;mapping=tex-text;"
. - 'bold' (bx/n) with NFSS spec.: <->"Libertinus
. Sans/B/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold small caps' (bx/sc) with NFSS spec.: <->"Libertinus
. Sans/B/OT:script=latn;language=DFLT;+smcp;mapping=tex-text;"
. - 'italic' (m/it) with NFSS spec.: <->"Libertinus
. Sans/I/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'italic small caps' (m/itsc) with NFSS spec.: <->"Libertinus
. Sans/I/OT:script=latn;language=DFLT;+smcp;mapping=tex-text;"
. - 'bold italic' (bx/it) with NFSS spec.: <->"Libertinus
. Sans/BI/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold italic small caps' (bx/itsc) with NFSS spec.: <->"Libertinus
. Sans/BI/OT:script=latn;language=DFLT;+smcp;mapping=tex-text;"
.................................................
答案1
这似乎是 Libertinus Sans BoldItalic 中的一个错误:粗体斜体字体仅根据 OpenType 样式字段为斜体,因此 XeTeX 将其选为常规斜体字体。您可以使用以下方法覆盖此决定
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Libertinus Sans}[
ItalicFont={Libertinus Sans Italic}
]
\begin{document}
Test
\textbf{Test}
\textit{Test}
\end{document}
或者您可以切换到 LuaTeX:LuaTeX 字体加载器无论如何都会忽略相关的 OpenType 值,因此问题不会出现在那里。
答案2
\documentclass{article}
\usepackage[usefilenames]{libertinus-otf}
\renewcommand\familydefault{\sfdefault}
\begin{document}
Test
\textbf{Test}
\textit{Test}
\end{document}