[dev-context] setupbodyfont

Wolfgang Schuster schuster.wolfgang at googlemail.com
Tue Jun 9 09:13:46 CEST 2009

Hi Hans,

I run with my simplefonts module in two problems when I try to set the  
the regard math and fallback fonts and I was only to solve them by  
of a few values.

1. I have to set the bodyfont at the same time when I set a individual  
font for
    serif, sans or mono. This works fine for the the three text style  
but not when
    I try to switch to a different math font, which is frozen with the  
    \setupbodyfont command and can only be changed when I the main  
    (created with \registerfontclass in \definetypeface) and the style  
    for rm (I need the 'rm' style to allow e.g. ss as document style).

    Here is a example to illustrate the problem:





% comment/uncomment the following two lines to see how
% the math font changes with/without these redefinitions

\undefinevalue{@f at st@rm}%


%\undefinevalue{@f at st@rm}%



\rmtf regular \it italic \bf bold \bi bolditalic

\sstf regular \it italic \bf bold \bi bolditalic

\tttf regular \it italic \bf bold \bi bolditalic

$$ c^2 = a^2 + b^2 $$


2. The fallback for the main style (i.e. \rmtf) is frozen too with
    the first \setupbodyfont line in the document with can be only reset
    when I undefine \newfontidentifier, a example for this is:

\starttypescript [serif] [mainfont]
     \definefontsynonym [Serif] [name:texgyrepagellaregular]  

\definetypeface [mainfont] [rm] [serif] [mainfont] [default]


\definefontfallback [mainfont] [name:texgyretermesregular]  
[0x0065-0x0070] [force=yes]

% The following line is necessary to enable the fallback font for the  
% style after the bodyfont is set, if this isn't done the complete text
% below is typeset in Pagella whereas e-p should be in Times





I would prefer something documented (e.g. \setupbodyfont[reload,...])  
which can
be used to get the same effect as I did with my hacks because I like  
now my new
font module, it's lot easier than direct method to set fallback fonts.


More information about the dev-context mailing list