[
https://issues.apache.org/jira/browse/PDFBOX-4545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16840074#comment-16840074
]
Tilman Hausherr commented on PDFBOX-4545:
-----------------------------------------
The method that you propose doesn't do what you suggested in the sentence
before. Asking PDFRenderer to subset the fonts isn't much different than asking
you to save the file first. (You could of course also set /FontFile2 directly
by accessing the structures with getCOSObject()).
Another possibility would be an optional fallback to the old code but this
sounds 1. risky, 2. would be yet another parameter.
What I'm thinking about is to improve the documentation, i.e. mention it in
PDFRenderer.
> PdfRenderer fails to render subsetted font
> ------------------------------------------
>
> Key: PDFBOX-4545
> URL: https://issues.apache.org/jira/browse/PDFBOX-4545
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel, Rendering
> Affects Versions: 2.0.15
> Reporter: Jason Kantz
> Priority: Minor
> Attachments: embedder.patch
>
>
> In 2.0.3, TrueTypeEmbedder initializes FONT_FILE2 with the full font (1) and
> then writes the subset later on save (2) (3).
> In 2.0.15 TrueTypeEmbedder now only initializes FONT_FILE2 if !embeddedSubset
> (4).
> This results in PDFRenderer failing to find and use the intended font when
> using a PDDocument that has never been saved.
> Attached patch restores the original behavior to work around the issue.
> (1)
> https://apache.googlesource.com/pdfbox/+/refs/tags/2.0.3/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java#82
> (2)
> https://apache.googlesource.com/pdfbox/+/refs/tags/2.0.3/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java#1128
> (3)
> https://apache.googlesource.com/pdfbox/+/refs/tags/2.0.3/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java#100
> (4)
> [https://apache.googlesource.com/pdfbox/+/refs/tags/2.0.15/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java#77]
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]