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). 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. 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. Dax On Mon, Oct 05, 2026 11:22 AM, Hans Hagen via ntg-context < [email protected]> wrote: > On 10/5/2026 5:29 AM, Dax Kelson via ntg-context wrote: > > Dear Hans, > > > > Our PDFs must keep the hinting of our old TrueType and Type 1 fonts, > > because readers view them at screen resolution in FreeType-based > > viewers. We do this now with our own writers. Because mainwriters is > > local, we switch the font's format to a name with no writer and write > > the objects from a later finalizer. > > > > 1. Would you accept lpdf.registerfontwriter(format, writer), and > > exported widtharray, tounicodedictionary and the registry/metadata > helpers? > > > > 2. Optionally, a switch to keep TrueType hinting as writettf.c does: > > cvt, fpgm, prep and PCLT copied, glyph instructions kept, composites > kept. > > > > 3. Optionally, carry Type 1 hstem/vstem and the Private hint keys into > > the CFF. > > > > We can contribute code for 2 and 3, and FreeType raster comparisons > > against pdfTeX. Point 1 alone would already help us. > > i suppose 2/3 make more sense but i have to look at it (what font for > instance, testcase etc) > > Hans > > ----------------------------------------------------------------- > 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 > > ___________________________________________________________________________________ >
hints-ttf.tex
Description: TeX document
hints-t1.tex
Description: TeX document
___________________________________________________________________________________ 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 ___________________________________________________________________________________
