Skip to content

Commit 7929250

Browse files
authored
Merge pull request #53 from robotools/type1_macroman
Type1 macroman
2 parents 31576d4 + 0e070a2 commit 7929250

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

Lib/extractor/formats/type1.py

+3-21
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def extractFontFromType1(
2929
doFeatures=False,
3030
customFunctions=[],
3131
):
32-
source = T1Font(pathOrFile)
32+
source = T1Font(pathOrFile, encoding="macroman")
3333
destination.lib["public.glyphOrder"] = _extractType1GlyphOrder(source)
3434
if doInfo:
3535
extractType1Info(source, destination)
@@ -163,24 +163,6 @@ def extractType1Glyphs(source, destination):
163163
# -----------
164164

165165

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-
183166
def _extractType1GlyphOrder(t1Font):
184-
interpreter = GlyphOrderPSInterpreter()
185-
interpreter.interpret(t1Font.data)
186-
return interpreter.glyphOrder
167+
glyphSet = t1Font.getGlyphSet()
168+
return list(glyphSet)

0 commit comments

Comments
 (0)