On 10/5/2026 9:12 PM, Dax Kelson via ntg-context wrote:
Hi Hans,
Two test files are attached. Both use free fonts from TeX Live, so they
run as they are:
- hints-ttf.tex: DejaVu Sans (TrueType, hinted; the accented letters are
composite glyphs).
- hints-t1.tex: Latin Modern Roman 10, lmr10.pfb (Type 1, hinted; it
uses subroutines, hint replacement and flex).
i just looked at the ttf rendering and see nothign bad, but sumatra
(mupdf) and okular on windows are quite ok
one problem, with hints is that now that we have variable fonts, we also
need to deal with these
Each prints the same 32 glyphs at 6.25, 9.375 and 12.5 bp, every glyph
at a fixed position, so LMTX and pdfTeX put each glyph in exactly the
same place and only the embedded font differs. Run each with context,
and with pdftex for comparison (the first lines of each file say how).
Then look at both PDFs at 100% in a viewer that uses FreeType hinting
(evince, okular, or pdftoppm at 96 dpi). With pdfTeX the stems snap to
whole pixels; with LMTX the glyphs are unhinted and look softer and
uneven at these sizes.
hm, looks ok here (ok, i have a relative high res sceen)
What we do in our setup now, which an option could do in LMTX:
- TrueType: keep cvt, fpgm and prep (and PCLT), keep the glyph
instructions, and keep composite glyphs as composites, as writettf.c does.
- Type 1 to CFF: keep the hstem/vstem hints (with hint replacement) in
the charstrings, and copy the hint keys of the Private dictionary
(BlueValues, OtherBlues, BlueScale, BlueShift, BlueFuzz, StdHW, StdVW,
StemSnapH, StemSnapV).
If you want, we can send a patch for either one, behind an option that
is off by default.
well, i can have a look, but don't want to complicate code too much
the composed char is the first look look at; we don't keep 'm as
composites (which is just a space optimization) is that we also want
outlines in mp and subsetting works better too
Hans
% wipe streams cache for tracing
\enabletrackers[fonts.cff.charstrings]
\starttext
\definecolor[ColorA][r=1,a=1,t=.5]
\definecolor[ColorB][r=g,a=1,t=.5]
\definefontfeature[xx][default][pfbfile=lmr10.pfb]
\startTEXpage[offset=0pt]
\startoverlay
{\ColorA\definedfont[file:lmr10.afm*xx @ 10pt]test}
{\ColorB\definedfont[file:lmroman10-regular.otf*xx @ 10pt]test}
\stopoverlay
\stopTEXpage
\stoptext
backend > fonts > start embedded fonts
backend > fonts > 1 : file 'lmr10.pfb', base
'XHTVJR+LMRoman10-Regular', instance 'lmr10pfb-0-0-0'
backend > fonts > 2 : file 'lmroman10-regular.otf', base
'SNRPFF+LMRoman10-Regular', instance 'lmroman10regularotf-1-0-0'
backend > fonts > stop embedded fonts
-----------------------------------------------------------------
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
___________________________________________________________________________________