仅向某些字体形状添加字体功能

仅向某些字体形状添加字体功能

如何向某些字体形状添加某些字体特征(例如连字)?

我们的想法是禁用 RB、RBI 形状等的连字,因为它们无论如何都会给我一个警告。

我简要介绍了一下文件,但无济于事。

MWE(没有字体文件则无法编译)

\documentclass{article}
\usepackage{fontspec}

\defaultfontfeatures[LinLibertine_]{
    Extension      = {.otf},
    UprightFont    = {*R},
    BoldFont       = {*RB},
    ItalicFont     = {*RI},
    BoldItalicFont = {*RBI},
    Ligatures      = {Common, Rare, Historic, TeX}, 
    Numbers        = {OldStyle},
}

\setmainfont{LinLibertine_}

\begin{document}
\textbf{ff fi fl...}
\end{document}

答案1

使用选项BoldFeatures={ Ligatures={...}},等等。

\documentclass{article}
\usepackage{fontspec}
\usepackage{lipsum}

\defaultfontfeatures[LinLibertine]{
    Extension      = {.otf},
    UprightFont    = {*_R},
    UprightFeatures = { Ligatures  = {Common, Rare, Historic, TeX}},
    BoldFont       = {*_RB},
    BoldFeatures = { Ligatures = {Common, Historic, TeX}},
    ItalicFont     = {*_RI},
    ItalicFeatures = { Ligatures  = {Common, Rare, Historic, TeX}},
    BoldItalicFont = {*_RBI},
    BoldItalicFeatures = { Ligatures = {Common, Historic, TeX}}, 
    Numbers        = {OldStyle},
}

\setmainfont{LinLibertine}

\begin{document}
\lipsum
\end{document}

您还可以尝试Ligatures=Rare默认打开并针对特定面部关闭BoldTialicFeatures={ Ligatures=NoRare }

相关内容