diff --git a/Lib/fontTools/ttLib/tables/_c_m_a_p.py b/Lib/fontTools/ttLib/tables/_c_m_a_p.py index 7f0d750ae..bd167cb3a 100644 --- a/Lib/fontTools/ttLib/tables/_c_m_a_p.py +++ b/Lib/fontTools/ttLib/tables/_c_m_a_p.py @@ -20,12 +20,12 @@ def _make_map(font, chars, gids): cmap = {} lenCmap = len(gids) glyphOrder = font.getGlyphOrder() - try: - names = list(map(operator.getitem, [glyphOrder]*lenCmap, gids )) - except IndexError: - getGlyphName = font.getGlyphName - names = list(map(getGlyphName, gids )) - list(map(operator.setitem, [cmap]*lenCmap, chars, names)) + for char,gid in zip(chars,gids): + try: + name = glyphOrder[gid] + except IndexError: + name = font.getGlyphName(gid) + cmap[char] = gid return cmap class table__c_m_a_p(DefaultTable.DefaultTable):