Allow loading zero-length tables

Fixes https://github.com/behdad/fonttools/issues/106
This commit is contained in:
Behdad Esfahbod 2014-01-30 16:48:11 -05:00
parent ff2dd56f86
commit 6338375bd8

View File

@ -55,14 +55,7 @@ class SFNTReader(object):
for i in range(self.numTables):
entry = self.DirectoryEntry()
entry.fromFile(self.file)
if entry.length > 0:
self.tables[Tag(entry.tag)] = entry
else:
# Ignore zero-length tables. This doesn't seem to be documented,
# yet it's apparently how the Windows TT rasterizer behaves.
# Besides, at least one font has been sighted which actually
# *has* a zero-length table.
pass
self.tables[Tag(entry.tag)] = entry
# Load flavor data if any
if self.flavor == "woff":