huhuang03 / sfntly

Automatically exported from code.google.com/p/sfntly
0 stars 0 forks source link

Index attempted to be read from is out of bounds: 4e #43

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Using font from http://img.dafont.com/dl/?f=escapeviawindow and passing it 
through the java sfnttool tool, it fails when trying to make an eot file

reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/extensions/UniversalLanguageSele
ctor/data/fontrepo/fonts/EscapeViaWindow$ java -jar 
/home/reedy/sfntly-builds/java-openjdk-7/sfnttool/sfnttool.jar -e -h -x 
EscapeViaWindow.ttf EscapeViaWindow.eot
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index attempted 
to be read from is out of bounds: 4e
        at com.google.typography.font.sfntly.data.ReadableFontData.readUByte(Unknown Source)
        at com.google.typography.font.sfntly.data.ReadableFontData.readULong(Unknown Source)
        at com.google.typography.font.sfntly.table.core.OS2Table.ulCodePageRange1(Unknown Source)
        at com.google.typography.font.tools.conversion.eot.EOTWriter.writeCodePages(Unknown Source)
        at com.google.typography.font.tools.conversion.eot.EOTWriter.convert(Unknown Source)
        at com.google.typography.font.tools.sfnttool.SfntTool.subsetFontFile(Unknown Source)
        at com.google.typography.font.tools.sfnttool.SfntTool.main(Unknown Source)

Original issue reported on code.google.com by tehre...@gmail.com on 15 Dec 2013 at 7:07

GoogleCodeExporter commented 9 years ago
The issue is that the font has a version 0 OS/2 table 
(http://www.microsoft.com/typography/otspec/os2ver0.htm#ur) which doesn't have 
the unicode / codepage range fields 
(http://www.microsoft.com/typography/otspec/os2.htm). The EOT converter does 
not check the OS/2 version, so it tries to request these fields which don't 
exist, hence the exception being thrown. 

Original comment by tinned...@yahoo.com on 18 Dec 2013 at 6:51