On 24 May 2016, at 15:57, Wolfgang Schuster
wrote: Meer, Hans van der 24. Mai 2016 um 15:04
Can someone explain to me the changes in fontsize in the following example? Enclosing the fontswitches in a group did not change the behaviour.
\setupbodyfont[dejavu,12pt] \def\MarkMasterA{\inmargin[location=left]{\bgroup\switchtobodyfont[9pt]\red Master\egroup}} \def\MarkMasterB{\inmargin[location=left]{\bgroup\usebodyfont[9pt]\red Master\egroup}} \starttext \startsection[title=\MarkMasterA First title] \input hawking \MarkMasterA \input hawking \stopsection \startsection[title=\MarkMasterB First title] \input hawking \MarkMasterB \input hawking \blank contextversion=\contextversion \stopsection \stoptext
In the first section the absolute value of 9 pt appears not to be honoured but it looks as if there is a reduction relative to the surrounding font. In the second section the size does not change and looks even bigger than the first one above.
I am baffled and do not understand why not all fontsizes are the same absolute 9pt as requested? When you flush the margin text in the heading its style (e.g. \tfa) is added to your font size for the margin text.
To get rid of the size change from \section in your example you can add the "reset" keyword to \switchtobodyfont.
Thanks, I really didn't know that, it could not spot it in my copy of "Fonts in Context". But although reset works for \switchtobodyfont, it is not working in \usebodyfont[reset,9pt] in the second section. There it keeps the size derived from the section title. Both commands however, are reported to inherit from \setupbodyfont (where the reset is named). Should that be correct? Hans van der Meer