在编写此最小文档时
\documentclass[a4paper]{scrartcl}
\usepackage{fontspec}
\setromanfont[]{Linux Libertine O}
\setsansfont[]{Linux Biolinum O}
\begin{document}
\section{Test \emph{emphasized} Text}
abcd ldbflsdbgf
\section{Test \textit{italic} Text}
\end{document}
使用 xetex (您必须在系统上安装了 Linux Libertine 和 Linux Biolinum)我得到以下结果:
强调/斜体的文本明显不如其余部分那么粗体。为什么会出现这种情况?如何改变?
答案1
如果我在我的系统上询问
otfinfo -i /usr/local/texlive/2018/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RBO.otf
答案是
Family: Linux Biolinum O
Subfamily: Bold
Full name: Linux Biolinum O Bold Oblique
PostScript name: LinBiolinumOBO
Version: Version 1.3.2
Unique ID: FontForge 2.0 : Linux Biolinum O Bold Oblique : 30-10-2012
Designer: Philipp H. Poll
Designer URL: http://www.linuxlibertine.org
Manufacturer: Philipp H. Poll
Vendor URL: http://www.linuxlibertine.org
Copyright: Linux Libertine by Philipp H. Poll,
Open Font under Terms of following Free Software Licenses:
GPL (General Public License) with font-exception and OFL (Open Font License).
Created with FontForge (http://fontforge.sf.net)
Sept 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,2012
License URL: http://www.fsf.org/licenses/gpl.html AND http://scripts.sil.org/OFL
License Description: GPL- General Public License AND OFL-Open Font License
Vendor ID: PfEd
这意味着该字体没有正确宣传其子系列,而这本应如此Bold Italic
。
解决方案:
\documentclass[a4paper]{scrartcl}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}[
BoldItalicFont=* Bold Oblique
]
\begin{document}
\section{Test \emph{emphasized} Text}
abcd ldbflsdbgf
\textbf{\textit{\textsf{Italic}}}
\section{Test \textit{italic} Text}
\end{document}
手动指定字体:
\documentclass[a4paper]{scrartcl}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\setsansfont{LinBiolinum}[
Extension=.otf,
UprightFont=*_R,
ItalicFont=*_RI,
BoldFont=*_RB,
BoldItalicFont=*_RBO,
]
\begin{document}
\section{Test \emph{emphasized} Text}
abcd ldbflsdbgf
\textbf{\textit{\textsf{Italic}}}
\section{Test \textit{italic} Text}
\end{document}
答案2
这取决于可用的字体。我似乎也缺少粗体斜体 Biolinum 作为系统字体,因为它不包含在SourceForge 分发。您可以替换类似的东西,如下所示(我抓取的是 Tex Gyre Heros,但也许有更好的东西可用):
\setmainfont[]{Linux Libertine O} %\setmainfont, rather than \setromanfont
\setsansfont[
ItalicFont = LinBiolinumOI,
BoldFont = LinBiolinumOB,
BoldItalicFont = TeXGyreHeros-BoldItalic,
BoldItalicFeatures = {Scale =0.85},
]{Linux Biolinum O}
看起来 egreg(像往常一样)有一个更好的解决方案!