Merge pull request #2785 from fonttools/fontbuilder-empty-cmap

[fontBuilder] don't error when there are zero code points
This commit is contained in:
Just van Rossum 2022-08-27 10:44:45 +02:00 committed by GitHub
commit a2f67b964a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -391,7 +391,7 @@ class FontBuilder(object):
sequence, but this is not policed. sequence, but this is not policed.
""" """
subTables = [] subTables = []
highestUnicode = max(cmapping) highestUnicode = max(cmapping) if cmapping else 0
if highestUnicode > 0xFFFF: if highestUnicode > 0xFFFF:
cmapping_3_1 = dict((k, v) for k, v in cmapping.items() if k < 0x10000) cmapping_3_1 = dict((k, v) for k, v in cmapping.items() if k < 0x10000)
subTable_3_10 = buildCmapSubTable(cmapping, 12, 3, 10) subTable_3_10 = buildCmapSubTable(cmapping, 12, 3, 10)