Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-4545

PdfRenderer fails to render subsetted font

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.0.15
    • None
    • PDModel, Rendering
    • None
    • Patch

    Description

      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

       

      Attachments

        1. embedder.patch
          1 kB
          Jason Kantz

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jkantz Jason Kantz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: