From dd2fea582acf48b3380c944546c67c1dfb56de6a Mon Sep 17 00:00:00 2001 From: jvr Date: Fri, 24 May 2002 16:52:07 +0000 Subject: [PATCH] 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 --- Lib/fontTools/ttLib/tables/T_S_I__0.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/fontTools/ttLib/tables/T_S_I__0.py b/Lib/fontTools/ttLib/tables/T_S_I__0.py index 988d29a1e..3381210f9 100644 --- a/Lib/fontTools/ttLib/tables/T_S_I__0.py +++ b/Lib/fontTools/ttLib/tables/T_S_I__0.py @@ -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)