Timur Kamalov created PDFBOX-3093:
-------------------------------------

             Summary: Exception in TTFParser
                 Key: PDFBOX-3093
                 URL: https://issues.apache.org/jira/browse/PDFBOX-3093
             Project: PDFBox
          Issue Type: Bug
            Reporter: Timur Kamalov
         Attachments: Skipping_font_tables_with_zero_length_.patch, resfont.ttf

The reason for this is an ambiguity in the TrueType specification. Namely, one 
of the font tables (OS/2) is present in the font directory with length 0. The 
specification itself is completely silent about this. 

The only other information I was able to find is:
- the FreeType font library 
(http://www.freetype.org/freetype2/docs/reference/ft2-truetype_tables.html#FT_Sfnt_Table_Info)
 assumes that any table having 0 length in the font directory is treated as 
missing.
- Google OpenType Sanitizer would report an error in such situation: 
https://github.com/khaledhosny/ots/blob/master/src/ots.cc, lines 575-578
- there are several related discussions at Adobe forums: 
https://forums.adobe.com/thread/1616317 , 
https://forums.adobe.com/thread/1611899

 As allowing zero length tables in TrueType fonts seems to be quite logical 
(and also implicitly confirmed by Adobe Acrobat validator), I've changed the 
TTFParser to skip tables with 0 length.

Attaching patch and font file. Will add test file also if necessary.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to