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

                 Key: PDFBOX-517
                 URL: https://issues.apache.org/jira/browse/PDFBOX-517
             Project: PDFBox
          Issue Type: Improvement
          Components: PDModel
    Affects Versions: 0.8.0-incubator
         Environment: Java
            Reporter: Antony Scerri


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).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to