Skip to content

Commit

Permalink
代码整理
Browse files Browse the repository at this point in the history
  • Loading branch information
TakWolf committed Nov 12, 2024
1 parent 86c0df1 commit a7eee48
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tools/services/font_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit a7eee48

Please sign in to comment.