On 10/22/2026 3:44 PM, Jim Diamond wrote:

So I begin to wonder whether there is something inside \switchtobodyfont
(or some macro it calls) which should be global but is not.

won't happen, it's already complex enough ... when we use font classes many defs are global (when we have delayed stuff) but we can't do that for everything (body font environments) and \globaldefs is very dangerous with unpredictable side effects!
Lots, as it turns out.

indeed
Hmmm... 1,059,247 lines in the log file, and counting.
That is too much education for this morning. :-)

one learns (and imagine pdftex or luatex ... ok, less detail on the one hand but more macro mess ... and you don't even get all tracing as some \tracing* can provide more detail
Even   grep font test-ncm-effects.log  has just under 74,000 lines.
There's a lot of stuff going on!

indeed, so then ponder why tex is so fast
Hmmm... now we are on to something (I think).  New example at bottom.

Test    ConTeXt version         |\usebodyfont[schola]|
A       2026.10.01      Absent
B       2026.10.01      Present
C       2026.10.16      Absent
D       2026.10.16      Present

maybe hashing introduces some randomness here
I should mention that even if the above line is
     \setbox0=\hbox{\switchtobodyfont[schola] Schola!!!}
the same issue happens.  Presumably entering internal horizontal mode to
create the hbox enters a group (or does actions similar to entering a group).

yes, it hooks into \everypar, sort of

I fully support (for what my opinion is worth) not making things more
complex.  However, I also shy away from claiming any non-trivial piece of
software is bug-free.

good, so a purely acadmic discussion then (not that there is something academic about tex except maybe knuths work)

No, but... if it is difficult or impossible to ensure everything is
properly initialized globally when a font is introduced inside a group,
then (since I'm a bit obsessive-compulsive about this) I'd take correct
behaviour over speed.

hm, not me, speed also matters and as mentioned, there is no robust solution anyway, there's always side effects
Now that I think about it, I do recall that in some other system (probably
pdftex using plain TeX) I did run into some similar issue where, if
something was first used inside a group, Bad Thingsā„¢ happened.  But the
specifics are currently lost in the depths of time.

old engines share font resources so ... even more hidden side effects
The difference between TeXlive and stand-alone is (apparently) that if
context finds the font in some cached "usual place" then it doesn't try to
use the font file in the \usefontpath directory.  Why exactly that works
when getting the font from the \usefontpath directory is another
interesting (to me) thing.

i don't think i should waste time on figuring out that difference .. we take our distribition as reference anyway
You mean this one:

\usetypescriptfile[newcomputermodern]
\setupbodyfont[newcomputermodern]
\starttext
\startchapter[title={Fun with Fonts in \ConTeXt}]
\showbodyfont[8pt]
\stopchapter
\stoptext

Yes, that works fine with TL.

But this:
\usepath[allncmfonts]
\usetypescriptfile[newcomputermodern]
\setupbodyfont[newcomputermodern]
\starttext
\startchapter[title={Fun with Fonts in \ConTeXt}]
\showbodyfont[8pt]
\stopchapter
\stoptext
errors out on the \showbodyfont[8pt] line, even when the entire set of
fonts from newcm-8.1.1.txz is in ./allncmfonts.

so there is something bad with the (fonts on) allncmfonts

maybe wipe the cache so that there i no clash with those tl system fonts

Since the same curious thing happens with the \usefontpath and
\usetypescriptfile lines commented out, I conclude that this peculiar thing
is not related to trying to use New CM.

But what parameters are changing (or not changing) when the first use of
Schola is inside an \hbox{}?

could be anything esp when a font is not found, they whatever is current wins

So many questions about fonts, so little time ...

lucky us that using fonts in the system paths works fine

Hans

(i only have tl in a linux vm so no testing with that one; installing and/or updating tl takes ages and too much disk space)


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
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