File tree 1 file changed +3
-21
lines changed
1 file changed +3
-21
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def extractFontFromType1(
29
29
doFeatures = False ,
30
30
customFunctions = [],
31
31
):
32
- source = T1Font (pathOrFile )
32
+ source = T1Font (pathOrFile , encoding = "macroman" )
33
33
destination .lib ["public.glyphOrder" ] = _extractType1GlyphOrder (source )
34
34
if doInfo :
35
35
extractType1Info (source , destination )
@@ -163,24 +163,6 @@ def extractType1Glyphs(source, destination):
163
163
# -----------
164
164
165
165
166
- class GlyphOrderPSInterpreter (PSInterpreter ):
167
- def __init__ (self ):
168
- PSInterpreter .__init__ (self )
169
- self .glyphOrder = []
170
- self .collectTokenForGlyphOrder = False
171
-
172
- def do_literal (self , token ):
173
- result = PSInterpreter .do_literal (self , token )
174
- if token == "/FontName" :
175
- self .collectTokenForGlyphOrder = False
176
- if self .collectTokenForGlyphOrder :
177
- self .glyphOrder .append (result .value )
178
- if token == "/CharStrings" :
179
- self .collectTokenForGlyphOrder = True
180
- return result
181
-
182
-
183
166
def _extractType1GlyphOrder (t1Font ):
184
- interpreter = GlyphOrderPSInterpreter ()
185
- interpreter .interpret (t1Font .data )
186
- return interpreter .glyphOrder
167
+ glyphSet = t1Font .getGlyphSet ()
168
+ return list (glyphSet )
You can’t perform that action at this time.
0 commit comments