Am 24.02.2025 um 04:22 schrieb autumnus:
Thanks for the solution.

Using absolute values in headings can solve the problem of font size changes
when font switches. But in the text, it still exists.

It took another look at the problem and noticed it happens only with the new compact mode for fonts which is now active by default (to use the old font mode use "context --nocompactfonts <filename>").


Below is a patch for compact mode (I guess \font_scale_defined_x and \font_scale_defined_xx have to be patched too) but Hans has to take a look at it.


\unprotect

\def\font_scale_defined
{\glyphscale\dimexpr\f_font_rscale_used\dimexpr\textface*\plushundred/\onepoint\relax\relax
   %% begin patch
   \ifempty\fontclass
     \applyfontstrategies
   \else
     \applyfontclassstrategies
   \fi
   %% end patch
   \ifskipfontcharacteristics \else
     \expand\everyfont % \setfontcharacteristics
     \expand\everyfontswitch
   \fi}

\protect

\usebodyfont[pagella]
\setupbodyfont[modern]

\starttext

{\tfd Latin Modern \switchtobodyfont[pagella]TeX Gyre Pagella}

{\tfd Latin Modern \setupbodyfont[pagella]TeX Gyre Pagella}

\stoptext


Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to