don't error when there are zero code points

This commit is contained in:
Just van Rossum 2022-08-27 10:29:12 +02:00
parent 9cb418cbfc
commit 8af6c16b6a

View File

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