假设我想按比例缩小文档中的英文文本和希伯来文文本。
为此,我使用SizeFeatures
以下方法:
% !TEX TS-program = xelatex
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\defaultfontfeatures{Scale=MatchUppercase, Ligatures=TeX}
\newfontfamily\hebrewfont{Arial}[Script=Hebrew]
\newfontfamily\englishfont{Latin Modern Roman}[Script=Latin,
SizeFeatures={
{Size={10-},Scale=0.6},
{Size={9-10},Scale=0.8},
{Size={8-},Scale=1},
}]
\begin{document}
א
\begin{english}
a{\bfseries A}
\end{english}
\end{document}
我现在认为粗体英文的缩放比例不正确:
我怎样才能fontspec
缩小英文粗体字样0.6
?
我认为答案在 fontspec 手册的第 3.5 节中 -
SizeFeatures = {
...
{ Size = ⟨size range⟩, ⟨font features⟩ },
{ Size = ⟨size range⟩, Font = ⟨font name⟩, ⟨font features⟩ },
...
}
但我不知道应该将什么传递给Font
和⟨font features⟩
。
答案1
您应该SizeFeatures
分别为每种字体指定(或指定确切的字体)。请注意,SizeFeatures
和其他字体功能之间存在层次结构。请查看fontspec
手册第 25 页“与其他功能的交互”。我还应该指出,您没有在里面指定所有尺寸SizeFeatures
,这将导致字体未在所有尺寸下定义。
% !TEX TS-program = xelatex
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\defaultfontfeatures{Scale=MatchUppercase, Ligatures=TeX}
\newfontfamily\hebrewfont{Arial}[Script=Hebrew]
\newfontfamily\englishfont{Latin Modern Roman}[Script=Latin,
SizeFeatures={
{Size={10-},Scale=0.6},
{Size={9-10},Scale=0.8},
{Size={8-9},Scale=1},
{Size={-8}}
},
BoldFeatures={
SizeFeatures={
{Size={10-},Scale=0.6},
{Size={9-10},Scale=0.8},
{Size={8-9},Scale=1},
{Size={-8}}
}
}]
\begin{document}
א
\begin{english}
a{\bfseries A}
\end{english}
\end{document}