Skip to content

cff: Allow empty array of operands for certain operators

Marek Kasik requested to merge mkasik/cairo:empty-delta-arrays into master

I have been looking at an issue reported in our downstream bugzilla today (see https://bugzilla.redhat.com/show_bug.cgi?id=1817958) which is about missing text in print preview and resulting print. This can be reproduced by "pdftocairo -pdf attestation-deplacement-fr.pdf output.pdf" on attestation-deplacement-fr.pdf.

This is specific to cairo, freetype opens the font correctly. The issue there is that a CFF font in the PDF has empty array of operands for FamilyBlues operator and cairo stops exporting fonts for the resulting PDF once it detects this.

Looking at what freetype does it seems that delta-encoded array of operands can be empty (see https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=25f845aa64d720052c92d6f524af7d8eae13db27). So operators BlueValues, OtherBlues, FamilyBlues, FamilyOtherBlues, StemSnapH and StemSnapV can have zero operands.

This commit checks whether current operator is among those listed and permits empty array of operands in such case.

Merge request reports