From e57d7142a0073e22f5a50878d0d871b5795767b3 Mon Sep 17 00:00:00 2001 From: Lasse Fister Date: Fri, 10 Feb 2017 18:39:27 +0100 Subject: [PATCH] [tools] Format codepoints according to the Namelist spec. --- tools/namelist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/namelist.py b/tools/namelist.py index 520c9ecee..6aca089bc 100755 --- a/tools/namelist.py +++ b/tools/namelist.py @@ -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__':