DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27107>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27107

TTF Reader fails

           Summary: TTF Reader fails
           Product: Fop
           Version: 0.20.5
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: general
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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

Reply via email to