[NTG-context] LMTX generates PDFs with non-working fonts on real printers

Leah Neukirchen leah at vuxu.org
Thu Oct 6 18:42:20 CEST 2022

Hans Hagen via ntg-context <ntg-context at ntg.nl> writes:

> On 10/6/2022 2:42 PM, Leah Neukirchen wrote:
>> But I also found yet another printer model that doesn't print:
>> the HP Color LaserJet 4700 (Model Q7492A, Firmware 20060821 46.031.1).
>> Since you seem to own the only printer that works ;) would
>> you be so kind and share which model you have?
> We have a HP ColorFlowMFP X585 full-width highspeed duplex inkjet
> printer (a couple of years old, always prints ok). So far we never
> heard of printing failures elsewhere.
>> I also wondered whether bisecting the snapshot-repo would work.
>> But I only have one LMTX binary; this font handling should be all in
>> lua code tho?
> It makes no sense to compare luametatex and luatex .. it's different
> machinery.
> Btw, some in the thread mention issues (like bad looking heros shapes)
> but in your case there is no print at all, so that is different. Isn't
> there some error log in these printer?

The error log didn't contain anything useful.

I made two experiments now.

First, I modified the MKIV PDF file to use the MKXL font stream, and
changed the text primitives to use low chars.  This renders fine on
all PDF viewers I found (text is garbled, of course), but it still
doesn't print.  So now I'm fairly sure now the bug is in the font stream.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.doctored.pdf
Type: application/pdf
Size: 8397 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20221006/a34ea490/attachment-0001.pdf>
-------------- next part --------------

I finally found a tool to analyze CID fonts at
I noticed two things:
1) the MKIX Top DICT INDEX doesn't contain /version, but the string is
   in the SID.  Unfortunately merely adding it to topdict in
   tablewriters.cff doesn't fix the printing bug.  But I'd still
   recommend doing so.

2) The Private DICT doesn't contain /StdHW /StdVW /StemSnapH /StemSnapV.
   Also BlueScale is 0.
   This should not matter for printing(?) but it explains why
   Adobe displays it differently! The hinting information is missing.

   Note that the code would copy this data but it's missing in the
   cffinfo already.

I'll attach both CFF dumps here, perhaps someone finds other issues.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: font-0008.mkiv.dump
Type: application/octet-stream
Size: 4829 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20221006/a34ea490/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: font-0008.mkxl.dump
Type: application/octet-stream
Size: 4053 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20221006/a34ea490/attachment-0003.obj>
-------------- next part --------------

Leah Neukirchen  <leah at vuxu.org>  https://leahneukirchen.org

More information about the ntg-context mailing list