Bug 27107 - TTF Reader fails
Summary: TTF Reader fails
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: 0.20.5
Hardware: PC All
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-20 12:30 UTC by Peter Schäfer
Modified: 2012-04-07 01:37 UTC (History)
0 users



Attachments
TrueType font with cmap (3,0) (77.42 KB, application/octet-stream)
2004-02-20 12:31 UTC, Peter Schäfer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Schäfer 2004-02-20 12:30:55 UTC
Reading fonts/BERLIN.TTF...

Number of glyphs in font: 119
Unicode cmap table not present
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(ArrayList.java:507)
        at java.util.ArrayList.get(ArrayList.java:324)
        at org.apache.fop.fonts.TTFFile.createCMaps(TTFFile.java:449)
        at org.apache.fop.fonts.TTFFile.readFont(TTFFile.java:439)
        at org.apache.fop.fonts.apps.TTFReader.loadTTF(TTFReader.java:222)
        at org.apache.fop.fonts.apps.TTFReader.main(TTFReader.java:184)


I found that the TrueType file contains a "cmap" table with platformID=3 and
encodingId=0 (Windows Symbol encoding, or whatever).

TTFReader expects encodingId = 1. However, the table contains readable data in
the correct format (format 4). After patching TTFFile.java, it created a
perfectly valid metrics file.

I might suggest that you apply this patch to org.apache.fop.fonts.TTFFile, line 185:

   if (cmap_pid == 3 && (cmap_eid == 1 || cmap_eid == 0))
Comment 1 Peter Schäfer 2004-02-20 12:31:53 UTC
Created attachment 10453 [details]
TrueType font with cmap (3,0)
Comment 2 Pascal Sancho 2007-11-20 01:25:06 UTC
confirmed with FOP 0.94 and TRUNK rev 591907:
unsupported format. Log says:
Parsing font...
Reading E:\recup\BERLIN.TTF...
Unicode cmap table not present
Unsupported format: Aborting

… no file is created
Comment 3 Glenn Adams 2012-04-07 01:37:34 UTC
resetting severity from major to normal pending further review