Applied patch from Owen Taylor that allows zero-length tables to be ignored. Added comment why.

git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@219 4cde692c-a291-49d1-8350-778aa11640f8
This commit is contained in:
jvr 2002-05-12 17:02:50 +00:00
parent 911b33d531
commit ce1d50aca8

View File

@ -33,7 +33,14 @@ class SFNTReader:
for i in range(self.numTables):
entry = SFNTDirectoryEntry()
entry.fromfile(self.file)
self.tables[entry.tag] = entry
if entry.length > 0:
self.tables[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
def has_key(self, tag):
return self.tables.has_key(tag)