don't blow up on orphaned VTT index tables

git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@259 4cde692c-a291-49d1-8350-778aa11640f8
This commit is contained in:
jvr 2002-05-24 16:52:07 +00:00
parent 02c17a7d3d
commit dd2fea582a

View File

@ -25,8 +25,11 @@ class table_T_S_I__0(DefaultTable.DefaultTable):
self.extra_indices = indices[-4:]
def compile(self, ttFont):
if not hasattr(self, "indices"):
# We have no corresponging table (TSI1 or TSI3); let's return
# no data, which effectively means "ignore us".
return ""
data = ""
size = struct.calcsize(tsi0Format)
for index, textLength, textOffset in self.indices:
data = data + struct.pack(tsi0Format, index, textLength, textOffset)
data = data + struct.pack(tsi0Format, 0XFFFE, 0, 0xABFC1F34)