mirror of
https://github.com/adobe-fonts/source-code-pro.git
synced 2026-04-26 03:00:26 -04:00
Use font.getGlyphID() instead
This commit is contained in:
@@ -68,14 +68,13 @@ def getGlyphNameFromFileName(filePath):
|
||||
def processFontFile(fontFilePath, svgFilePathsList):
|
||||
# retrieve the font's glyph order, to determine the GID later
|
||||
font = ttLib.TTFont(fontFilePath)
|
||||
glyphOrder = font.getGlyphOrder()
|
||||
|
||||
# first create a dictionary because the SVG glyphs need to be sorted in the table
|
||||
svgDocsDict = {}
|
||||
for svgFilePath in svgFilePathsList:
|
||||
gName = getGlyphNameFromFileName(svgFilePath)
|
||||
try:
|
||||
gid = glyphOrder.index(gName)
|
||||
gid = font.getGlyphID(gName)
|
||||
except ValueError:
|
||||
print >> sys.stderr, "ERROR: Could not find a glyph named %s in the font %s." % (gName, os.path.split(fontFilePath)[1])
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user