pdf-raku / PDF-Font-Loader-raku

Font loader for the PDF tool-chain
Artistic License 2.0
1 stars 3 forks source link

Custom CFF glyph names breaking encoding #4

Closed dwarring closed 4 years ago

dwarring commented 4 years ago

Found running pdf2image.raku (PDF::To::Cairo non-module) on PDF file 000377.pdf.

Embedded CFF font have custom glyph names, e.g., GMOICK+MSTT31c531S00 which has /g38 /g179...

dwarring commented 4 years ago

Font also lacks ToUnicode or an internal CMAP so there's no way to map the glyphs to characters. For example, If I try to cut and paste from xPdf I end up with junk. Almost as if it's deliberately obfuscated.

Suggest detecting this case and adding an 'encoder' that can render only.

dwarring commented 4 years ago

^^ Have been experimenting directly on the extracted with Cairo via the toy text. I can't display anything but .notdef for any character codes.

dwarring commented 4 years ago

Only a real problem when extracting or reusing some PDF fonts. Needs more analysis. Just adding a warning for now.