0

Suppose I want to scale down the English text in proportion to Hebrew text in my document.

To do that I use SizeFeatures in the following way:

% !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}

I now reckon that English in bold face is not scaled correctly:

enter image description here

How can I instruct fontspec to scale down English bold face to 0.6 too?

I think that the answer is in §3.5 of the fontspec manual -

SizeFeatures = {
...
{ Size = ⟨size range⟩, ⟨font features⟩ },
{ Size = ⟨size range⟩, Font = ⟨font name⟩, ⟨font features⟩ },
...
}

but I don't know what I should pass to Font and ⟨font features⟩.

1 Answer 1

1

You should specify SizeFeatures for each typeface separately (or specify the exact font). Note that there is a heirarchy between SizeFeatures and other font features. Have a look at page 25 of fontspec manual "Interaction with other features". I should also point out that you did not specify al sizes inside SizeFeatures, which will result with the font not defined at all sizes.

% !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}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .