[subset] Fix --no-hinting --desubroutinize

Fixes https://github.com/fonttools/fonttools/issues/1360
This commit is contained in:
Behdad Esfahbod 2018-11-02 17:52:15 -04:00
parent cc540c41e9
commit 76c85e3c3b

View File

@ -2279,7 +2279,8 @@ class _DehintingT2Decompiler(psCharStrings.T2WidthExtractor):
# The status means:
# 0: after dropping hints, this charstring is empty
# 1: after dropping hints, there may be more hints
# continuing after this
# continuing after this, or there might be
# other things. Not clear yet.
# 2: no more hints possible after this charstring
self.status = 0
# Has hintmask instructions; not recursive
@ -2390,11 +2391,12 @@ class _DehintingT2Decompiler(psCharStrings.T2WidthExtractor):
if subr_hints.has_hint:
hints.has_hint = True
# 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
# 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
elif subr_hints.status == 0:
hints.deletions.append(index)