File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -131,8 +131,12 @@ def remove_glyf_instructions(tt):
131131 for glyph in tt ["glyf" ].glyphs .values ():
132132 glyph .expand (tt ["glyf" ])
133133 if hasattr (glyph , "program" ) and glyph .program .bytecode != array .array ("B" , []):
134- glyph .program .bytecode = array .array ("B" , [])
135- glyph_number += 1
134+ if glyph .isComposite ():
135+ del glyph .program
136+ glyph_number += 1
137+ else :
138+ glyph .program .bytecode = array .array ("B" , [])
139+ glyph_number += 1
136140 return glyph_number
137141
138142
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ def font_validator(filepath):
2424 assert "TTFA" not in tt
2525 for glyph in tt ["glyf" ].glyphs .values ():
2626 glyph .expand (tt ["glyf" ])
27+ if glyph .isComposite ():
28+ assert not hasattr (glyph , "program" )
2729 if hasattr (glyph , "program" ):
2830 assert glyph .program .bytecode == array .array ("B" , [])
2931 assert tt ["gasp" ].gaspRange == {65535 : 15 }
You can’t perform that action at this time.
0 commit comments