When compiling cmap format 6, fill in missing codes
They should just map to glyph 0. Fixes https://github.com/behdad/fonttools/issues/42
This commit is contained in:
parent
8c35239853
commit
13a08d0c3a
@ -868,11 +868,9 @@ class cmap_format_6(CmapSubtable):
|
||||
cmap = self.cmap
|
||||
codes = cmap.keys()
|
||||
if codes: # yes, there are empty cmap tables.
|
||||
codes.sort()
|
||||
lenCodes = len(codes)
|
||||
assert codes == range(codes[0], codes[0] + lenCodes)
|
||||
codes = range(codes[0], codes[-1] + 1)
|
||||
firstCode = codes[0]
|
||||
valueList = map(operator.getitem, [cmap]*lenCodes, codes)
|
||||
valueList = [cmap.get(code, ".notdef") for code in codes]
|
||||
valueList = map(ttFont.getGlyphID, valueList)
|
||||
glyphIndexArray = array.array("H", valueList)
|
||||
if sys.byteorder <> "big":
|
||||
|
Loading…
x
Reference in New Issue
Block a user