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

PD Fonts do not attempt to load from the environment if an embed font cannot be loaded

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 0.8.0-incubator
    • 0.8.0-incubator
    • PDModel
    • None
    • Java

    Description

      When one of the PD Font classes such as PDTrueTypeFont.java attempt to load embeded fonts (through AWT) which fail it simply resorts to using the standard font. In my instance an ebeded TrueType font did not contain a "name" table and so AWT failed to load it (not sure if thats an error in the PDF font or AWTs handling).

      Instead it should probably check to see if a matching font is available from the environment first. In conjunction with the fix in PDFBox-516 this has a much better chance of identifying and using the correct font for processing the streams contents. Attached is a patch for PDTrueTypeFont.java to demonstrate such a fix (this does not include any additional logging if it fails to find one from the environment as its a case of attempting to fix an already broken situation so doesnt really warrant it).

      Attachments

        1. PDTrueTypeFont.diff
          0.6 kB
          Antony Scerri

        Activity

          People

            Unassigned Unassigned
            antonyscerri Antony Scerri
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: