[subset] Fix CFF hint-stripping

Was causing OTS failure when subsetting 'apple' glyph of
InformaPro-Light.otf for example.
This commit is contained in:
Behdad Esfahbod 2013-10-28 15:18:07 +01:00
parent 8c5c966471
commit 2a70f4a45f

View File

@ -1290,6 +1290,8 @@ def drop_hints(self):
continue continue
i += 1 i += 1
# TODO: we currently don't drop calls to "empty" subroutines.
assert len(self.program) assert len(self.program)
del self._hints del self._hints
@ -1445,6 +1447,12 @@ class _DehintingT2Decompiler(psCharStrings.SimpleT2Decompiler):
hints.status = 2 hints.status = 2
break; break;
hints.last_checked = index hints.last_checked = index
if hints.status != 2:
# Decide where to chop off from
if subr_hints.status == 0:
hints.last_hint = index
else:
hints.last_hint = index - 2 # Leave the subr call in
@_add_method(ttLib.getTableClass('CFF ')) @_add_method(ttLib.getTableClass('CFF '))
def prune_post_subset(self, options): def prune_post_subset(self, options):