[
https://issues.apache.org/jira/browse/PDFBOX-5713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17788330#comment-17788330
]
Jaromír Dobrý commented on PDFBOX-5713:
---------------------------------------
Yes, it should fail if the binary segment is first because it is against the
IBM PC format. It says that the binary part should be converted to hex ascii
and sent to printer. But the type1 font should start with "%!FontType1", not
with some binary data in hex form - they should be placed after "eexec". The
order of the segments is important here and if you ignore it, you will parse an
invalid font without noticing (or maybe worse, parse some weird but valid font
with incorrect result - I can't imagine it now but I cannot exclude this
possibility and it is easier just to check it).
At the other side, it is absolutely ok to reject the wrapped PFA because it is
not in the expected format. I used it here just to illustrate how IBM PC format
allows weird things by definition. Also thank you for allowing the missing EOF
marker. I think that there are fonts with EOF missing.
> PfbParser fails to parse PFB font with multiple binary records.
> ---------------------------------------------------------------
>
> Key: PDFBOX-5713
> URL: https://issues.apache.org/jira/browse/PDFBOX-5713
> Project: PDFBox
> Issue Type: Bug
> Components: FontBox
> Affects Versions: 3.0.0 PDFBox
> Reporter: Jaromír Dobrý
> Priority: Major
> Attachments: 5040.Download_Fonts.pdf, DejaVuSerifCondensed.pfb,
> PDFBOX-5713.diff, PDFBOX-5713_minimal.diff, pfa_wrapped.pfb,
> type1_embedded.pdf
>
>
> * The attached PFB font can be opened in FontForge but PfbParser in fontbox
> fails to read it.
> * The problem is that fontbox assumes there are three records (ascii,
> binary, ascii) in the PFB file but the binary part is split into multiple
> shorter chunks (i.e. ascii, binary, ..., binary, ascii).
> * I didn't find that this is forbidden and according to FontForge behavior
> it seems to be valid.
> * The fix seems to be easy, it is probably sufficient to concatenate the
> binary records together in PfbParser and the result will work correctly.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]