Open jackytwh opened 6 years ago
This font appears to be incredibly broken. Fontval shows about a million GPOS errors, and running the otf through TTX yields:
Dumping "..\andika-regular.otf" to "..\andika-regular.ttx"...
Dumping 'GlyphOrder' table...
Dumping 'head' table...
Dumping 'hhea' table...
Dumping 'maxp' table...
Dumping 'OS/2' table...
Dumping 'name' table...
Dumping 'cmap' table...
Dumping 'post' table...
Dumping 'CFF ' table...
Dumping 'FFTM' table...
Dumping 'GDEF' table...
WARNING: Unknown Coverage format: 32464
WARNING: Unknown Coverage format: 29464
WARNING: Unknown Coverage format: 32072
WARNING: Unknown Coverage format: 29594
ERROR: An exception occurred during the decompilation of the 'GPOS' table
Traceback (most recent call last):
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\ttFont.py", line 366, in __getitem__
return self.tables[tag]
KeyError: 'GPOS'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\ttFont.py", line 385, in __getitem__
table.decompile(data, self)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otBase.py", line 42, in decompile
self.table.decompile(reader, font)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otBase.py", line 626, in decompile
table[conv.name] = conv.read(reader, font, table)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otConverters.py", line 507, in read
table.decompile(reader, font)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otBase.py", line 622, in decompile
table[conv.name] = conv.readArray(reader, font, table, countValue)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otConverters.py", line 145, in readArray
l.append(self.read(reader, font, tableDict))
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otConverters.py", line 507, in read
table.decompile(reader, font)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otBase.py", line 622, in decompile
table[conv.name] = conv.readArray(reader, font, table, countValue)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otConverters.py", line 145, in readArray
l.append(self.read(reader, font, tableDict))
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otConverters.py", line 507, in read
table.decompile(reader, font)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otBase.py", line 626, in decompile
table[conv.name] = conv.read(reader, font, table)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otConverters.py", line 507, in read
table.decompile(reader, font)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otBase.py", line 626, in decompile
table[conv.name] = conv.read(reader, font, table)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otConverters.py", line 507, in read
table.decompile(reader, font)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otBase.py", line 622, in decompile
table[conv.name] = conv.readArray(reader, font, table, countValue)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otConverters.py", line 145, in readArray
l.append(self.read(reader, font, tableDict))
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otConverters.py", line 390, in read
table.decompile(reader, font)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otBase.py", line 626, in decompile
table[conv.name] = conv.read(reader, font, table)
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otConverters.py", line 223, in read
return reader.readUShort()
File "c:\program files\python36\lib\site-packages\fontTools\ttLib\tables\otBase.py", line 134, in readUShort
value, = struct.unpack(">H", self.data[pos:newpos])
struct.error: unpack requires a buffer of 2 bytes
Dumping 'GPOS' table...
Dumping 'GSUB' table...
Dumping 'hmtx' table...
That might look like TTX is succeeding where Fontkit isn't, but what really happens is that there is byte corruption in the GPOS table, and TTX just happens to try to keep reading even though what it thinks it's reading is completely nonsense after the first error.
The solution here is probably to get a new copy of the font and verify that this new copy is not broken, or if it is letting the foundry that makes it know they have released a broken font and using a different font in your codebase instead.
On the fontkit side, it would probably also be useful if the error wasn't just "Unknown version 32464" but also indicated which structure hierarchy that error occurred in /cc @devongovett
Here is the code:
Here is the output:
The font is attached. Fontkit version is 1.7.7.
andika-regular.otf.zip