From 2500153078a85409202687952de21fd04e19ae97 Mon Sep 17 00:00:00 2001 From: TakWolf Date: Thu, 7 Nov 2024 20:36:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=94=99=E8=AF=AF=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=B6=88=E6=81=AF=E6=8F=90=E7=A4=BA=EF=BC=9A=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=20unicode=20=E4=B8=8D=E5=90=8C=E9=A3=8E?= =?UTF-8?q?=E6=A0=BC=E5=AD=97=E5=BD=A2=E7=9A=84=20bitmap=20=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E7=9B=B8=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/services/check_service.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/services/check_service.py b/tools/services/check_service.py index dc3b975..442d840 100644 --- a/tools/services/check_service.py +++ b/tools/services/check_service.py @@ -32,11 +32,12 @@ def check_glyph_files(font_config: FontConfig): block = unidata_blocks.get_block_by_code_point(code_point) east_asian_width = unicodedata.east_asian_width(chr(code_point)) - bitmap_strings = set() + bitmap_strings = {} for glyph_file in set(flavor_group.values()): bitmap_string = str(glyph_file.bitmap) - assert bitmap_string not in bitmap_strings, f"[{font_config.font_size}px] duplicate glyph bitmaps: '{glyph_file.file_path}'" - bitmap_strings.add(bitmap_string) + duplicate_glyph_file = bitmap_strings.get(bitmap_string, None) + assert duplicate_glyph_file is None, f"[{font_config.font_size}px] duplicate glyph bitmaps:\n'{glyph_file.file_path}'\n'{duplicate_glyph_file.file_path}'" + bitmap_strings[bitmap_string] = glyph_file if width_mode_dir_name == 'common' or width_mode_dir_name == 'monospaced': assert glyph_file.height == font_config.font_size, f"[{font_config.font_size}px] glyph bitmap error: '{glyph_file.file_path}'"