From a7eee48c929c4d883757b66e8a679aac12250c6e Mon Sep 17 00:00:00 2001 From: TakWolf Date: Tue, 12 Nov 2024 03:35:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/services/font_service.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/services/font_service.py b/tools/services/font_service.py index 7d00f92..4788b70 100644 --- a/tools/services/font_service.py +++ b/tools/services/font_service.py @@ -24,11 +24,7 @@ def load(font_config: FontConfig) -> 'DesignContext': context.update(glyph_file_util.load_context(path_define.patch_glyphs_dir.joinpath(str(font_config.font_size), width_mode_dir_name))) contexts[width_mode_dir_name] = context - glyph_files = {} - for width_mode in configs.width_modes: - glyph_files[width_mode] = dict(contexts['common']) - glyph_files[width_mode].update(contexts[width_mode]) - for flavor_group in glyph_files[width_mode].values(): + for flavor_group in context.values(): if 'zh_cn' in flavor_group: flavor_group['zh_hans'] = flavor_group['zh_cn'] if 'zh_tr' in flavor_group: @@ -39,6 +35,11 @@ def load(font_config: FontConfig) -> 'DesignContext': flavor_group[None] = flavor_group[language_flavor] break + glyph_files = {} + for width_mode in configs.width_modes: + glyph_files[width_mode] = dict(contexts['common']) + glyph_files[width_mode].update(contexts[width_mode]) + return DesignContext(font_config, glyph_files) font_config: FontConfig