From 76c85e3c3b6f2fa0fa4a8bdec7036b4bb06c6154 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 2 Nov 2018 17:52:15 -0400 Subject: [PATCH] [subset] Fix --no-hinting --desubroutinize Fixes https://github.com/fonttools/fonttools/issues/1360 --- Lib/fontTools/subset/__init__.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Lib/fontTools/subset/__init__.py b/Lib/fontTools/subset/__init__.py index a1e2bbfc5..e1cb5fbdc 100644 --- a/Lib/fontTools/subset/__init__.py +++ b/Lib/fontTools/subset/__init__.py @@ -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)