diff --git a/Lib/extractor/formats/type1.py b/Lib/extractor/formats/type1.py index 3aee394..dc8e3ca 100644 --- a/Lib/extractor/formats/type1.py +++ b/Lib/extractor/formats/type1.py @@ -29,7 +29,7 @@ def extractFontFromType1( doFeatures=False, customFunctions=[], ): - source = T1Font(pathOrFile) + source = T1Font(pathOrFile, encoding="macroman") destination.lib["public.glyphOrder"] = _extractType1GlyphOrder(source) if doInfo: extractType1Info(source, destination) @@ -163,24 +163,6 @@ def extractType1Glyphs(source, destination): # ----------- -class GlyphOrderPSInterpreter(PSInterpreter): - def __init__(self): - PSInterpreter.__init__(self) - self.glyphOrder = [] - self.collectTokenForGlyphOrder = False - - def do_literal(self, token): - result = PSInterpreter.do_literal(self, token) - if token == "/FontName": - self.collectTokenForGlyphOrder = False - if self.collectTokenForGlyphOrder: - self.glyphOrder.append(result.value) - if token == "/CharStrings": - self.collectTokenForGlyphOrder = True - return result - - def _extractType1GlyphOrder(t1Font): - interpreter = GlyphOrderPSInterpreter() - interpreter.interpret(t1Font.data) - return interpreter.glyphOrder + glyphSet = t1Font.getGlyphSet() + return list(glyphSet)