[NTG-context] set fallback in \definefont

Wolfgang Schuster wolfgang.schuster.lists at gmail.com
Mon Feb 15 22:30:17 CET 2021



Pablo Rodriguez schrieb am 15.02.2021 um 21:51:
> On 2/15/21 8:47 PM, Mohammad Hossein Bateni wrote:
>> Hi,
>>
>> Is there a way to set the fallback for fonts when we define them not as
>> a typescript but using \definefont?
>>
>> \definefont[MyFont][Font.otf*MyFeatures]
>>
>> Is there a default fallback one can specify?
>> Is simplefonts module deprecated or discouraged now?
> 
> Hi Mohammad,
> 
> the simplefonts module has been deprecated, since it has been
> implemented in the ConTeXt core (see below).
> 
> \definefontfallback might be the command you are looking for.

You need also \definefontsynonym but it's easier to create a new 
typeface (fontfamily) and load it with \switchtobodyfont.

\definefontfallback
   [AnotherFontFallback]
   [file:texgyreherosregular*default]
   [lowercasenormal]
   [force=yes]

\definefontsynonym
   [AnotherFontMain]
   [file:texgyrepagellaregular]
   [fallbacks=AnotherFontFallback]

\definefont [AnotherFont] [AnotherFontMain*default]

\starttext

\dorecurse{26}{\convertnumber{A}{\recurselevel}\space}\par
\dorecurse{26}{\convertnumber{a}{\recurselevel}\space}

\AnotherFont

\dorecurse{26}{\convertnumber{A}{\recurselevel}\space}\par
\dorecurse{26}{\convertnumber{a}{\recurselevel}\space}

\stoptext

Wolfgang


More information about the ntg-context mailing list