1
0
mirror of https://github.com/google/fonts.git synced 2025-01-05 17:05:26 +03:00

[tools] Format codepoints according to the Namelist spec.

This commit is contained in:
Lasse Fister 2017-02-10 18:39:27 +01:00
parent 72b49bd4d7
commit e57d7142a0

View File

@ -26,12 +26,12 @@ from fontTools.unicode import Unicode
def main(file_name):
excluded_chars = ["????", "SPACE", "NO-BREAK SPACE"]
font = TTFont(file_name)
for cmap in font["cmap"].tables:
for cmap in font["cmap"].tables:
char_list = sorted(cmap.cmap.items())
for item in char_list:
item_description = Unicode[item[0]]
if item_description not in excluded_chars:
print hex(item[0]), item_description
print '0x{0:04X}'.format(item[0]), item_description
font.close()
if __name__ == '__main__':