From 7268e24408586e5a52d716149cd214a301924778 Mon Sep 17 00:00:00 2001 From: Just Date: Mon, 21 Feb 2000 21:30:32 +0000 Subject: [PATCH] be relaxed about zero padding the input data to 4-byte boundaries git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@87 4cde692c-a291-49d1-8350-778aa11640f8 --- Lib/fontTools/ttLib/tables/_h_e_a_d.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/fontTools/ttLib/tables/_h_e_a_d.py b/Lib/fontTools/ttLib/tables/_h_e_a_d.py index 5eb669ef5..3ba88c5c1 100644 --- a/Lib/fontTools/ttLib/tables/_h_e_a_d.py +++ b/Lib/fontTools/ttLib/tables/_h_e_a_d.py @@ -33,7 +33,10 @@ class table__h_e_a_d(DefaultTable.DefaultTable): dependencies = ['maxp', 'loca'] def decompile(self, data, ttFont): - sstruct.unpack(headFormat, data, self) + dummy, rest = sstruct.unpack2(headFormat, data, self) + if rest: + # this is quite illegal, but there seem to be fonts out there that do this + assert rest == "\0\0" self.unitsPerEm = int(self.unitsPerEm) self.strings2dates()