[NTG-context] lmtx: new text & math font stuff

Hans Hagen j.hagen at xs4all.nl
Wed Dec 30 16:53:05 CET 2020


As you know, lmtx is also a place for experiments. Currently I'm playing 
a bit with fonts. Recently (as mentioned a whil eback) I added glyph 
scaling which permits interesting trickery, although one needs to be 
aware of how it combines with other features. Here's an example:

        {\glyph xoffset -.2ex yoffset -.4ex `E}%
        {\glyph xoffset -.4ex options "C0 `X}}

     \dorecurse{100}{ x \UnKernedTeX}

There are alse \glyphxscale cum suis but again, beware that it might 
influence things when not used grouped.

At some point this will be an option in scaled fonts (think of \tfc and 
such). It saves instances. You can get an idea with:


The 'text' in this command suggests that we can also do that with math 
and indeed we have


These directives have to come *before* loading fonts in order to be 
effective. Especially the math can bring down the number of font 
instances: text, script and scriptscript all use the same instance, 
which is good news. The bad news is that it's up to users to check how 
this plays out. There are some differences due to the fact that scaling 
happens elsewhere and otherwise which results in tiny differences (4/5th 

As said, these are experiments so ity might progress. I post 
intermediate versions because that way I can control it better. There is 
another variant in the planning.

Yet another expriment (undecided if that will stay, i played with if 
before and then rejected it):


If it stays I probbably have to patch some other code to better suit it.

Overall, although in math it add to the overhead, due to the fact that 
math is hardly demanding (makes only a fraction of the rendering) the 
memory footprint can be quite a bit lower and performance a bit better 
(not that much). The measures used in rendering are kind of floating 
(recalculated often) when these mechanisms are enabled but my impression 
is that todays compilers make that hardly noticeable.

As usual, it opens up possibilities, but of course at the price of 


                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl

More information about the ntg-context mailing list