Skip to content

Commit

Permalink
修复默认 flavor
Browse files Browse the repository at this point in the history
  • Loading branch information
TakWolf committed Nov 11, 2024
1 parent 6486f01 commit 249d8a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/services/check_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def check_glyph_files(font_config: FontConfig):
width_mode_dir = path_define.patch_glyphs_dir.joinpath(str(font_config.font_size), width_mode_dir_name)
context = glyph_file_util.load_context(width_mode_dir)
for code_point, flavor_group in context.items():
assert '' in flavor_group, f'[{font_config.font_size}px] missing default flavor: {width_mode_dir_name} {code_point:04X}'
assert None in flavor_group, f'[{font_config.font_size}px] missing default flavor: {width_mode_dir_name} {code_point:04X}'

if code_point == -1:
block = None
Expand Down
4 changes: 2 additions & 2 deletions tools/services/font_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def load(font_config: FontConfig) -> 'DesignContext':
flavor_group['zh_hans'] = flavor_group['zh_cn']
if 'zh_tr' in flavor_group:
flavor_group['zh_hant'] = flavor_group['zh_tr']
if '' not in flavor_group:
if None not in flavor_group:
for language_flavor in configs.language_file_flavors:
if language_flavor in flavor_group:
flavor_group[''] = flavor_group[language_flavor]
flavor_group[None] = flavor_group[language_flavor]
break

return DesignContext(font_config, glyph_files)
Expand Down

0 comments on commit 249d8a3

Please sign in to comment.