[
https://issues.apache.org/jira/browse/PDFBOX-5713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17786249#comment-17786249
]
Jaromír Dobrý commented on PDFBOX-5713:
---------------------------------------
>> IMHO the PFB_RECORDS should be removed.
I think it's a bit more complicated, read further...
>>The segments can be in any order.
>>So this should be collected into two byte arrays, or byte output streams.
Yes, they can be in any order but it doesn't mean that you can collect all
ascii and all binary segments separately without keeping this order. The
specification says that you should convert the binary segments to hex-streams
and send them to the printer. If you want to take this literally, the only
think you can do is to follow these instructions, therefore create PFA and
parse it.
Or the other possibility is to admit that you will not support everything
possible and hope that nobody will do such weird things.
>>Modifying the loop variable within the loop is considered a no-no by Sonar.
Ok, is a while loop better for you?
> 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, 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]