Skip to content

Commit

Permalink
调整 mapping 文件目录
Browse files Browse the repository at this point in the history
  • Loading branch information
TakWolf committed Nov 24, 2024
1 parent 824dc6d commit a72fe0b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions assets/fonts/ark-pixel/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sha": "c53fe806c9c62cda40ca5c126dead019b7a8eb30",
"sha": "1ae98ca77971fce169e462f1c72dc28148554af0",
"version": "develop",
"version_url": "https://github.com/TakWolf/ark-pixel-font/tree/develop",
"asset_url": "https://github.com/TakWolf/ark-pixel-font/archive/c53fe806c9c62cda40ca5c126dead019b7a8eb30.zip"
"asset_url": "https://github.com/TakWolf/ark-pixel-font/archive/1ae98ca77971fce169e462f1c72dc28148554af0.zip"
}
4 changes: 2 additions & 2 deletions tools/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def main(
update_service.setup_ark_pixel_glyphs()

mappings = [
glyph_mapping_util.load_mapping(path_define.ark_pixel_glyphs_dir.joinpath('cjk-radicals-supplement-mapping.yml')),
glyph_mapping_util.load_mapping(path_define.ark_pixel_glyphs_dir.joinpath('kangxi-radicals-mapping.yml')),
glyph_mapping_util.load_mapping(path_define.mappings_dir.joinpath('cjk-radicals-supplement.yml')),
glyph_mapping_util.load_mapping(path_define.mappings_dir.joinpath('kangxi-radicals.yml')),
]
dump_configs = DumpConfig.load()
fallback_configs = FallbackConfig.load()
Expand Down
1 change: 1 addition & 0 deletions tools/configs/path_define.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
cache_dir = project_root_dir.joinpath('cache')
downloads_dir = cache_dir.joinpath('downloads')
ark_pixel_glyphs_dir = cache_dir.joinpath('ark-pixel-glyphs')
mappings_dir = cache_dir.joinpath('mappings')

build_dir = project_root_dir.joinpath('build')
dump_dir = build_dir.joinpath('dump')
Expand Down
5 changes: 2 additions & 3 deletions tools/services/font_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ def load(font_config: FontConfig, mappings: list[dict[int, SourceFlavorGroup]])
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

if width_mode_dir_name == 'common':
for mapping in mappings:
glyph_mapping_util.apply_mapping(context, mapping)
for mapping in mappings:
glyph_mapping_util.apply_mapping(context, mapping)

for flavor_group in context.values():
if 'zh_cn' in flavor_group:
Expand Down
5 changes: 3 additions & 2 deletions tools/services/update_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ def setup_ark_pixel_glyphs():

if path_define.ark_pixel_glyphs_dir.exists():
shutil.rmtree(path_define.ark_pixel_glyphs_dir)
if path_define.mappings_dir.exists():
shutil.rmtree(path_define.mappings_dir)
for font_size in [10, 12]:
shutil.copyfile(source_unzip_dir.joinpath('assets', 'glyphs', str(font_size), 'config.yml'), path_define.patch_glyphs_dir.joinpath(str(font_size), 'config.yml'))
shutil.copyfile(source_unzip_dir.joinpath('LICENSE-OFL'), font_ark_pixel_dir.joinpath('LICENSE.txt'))
source_unzip_dir.joinpath('assets', 'glyphs').rename(path_define.ark_pixel_glyphs_dir)
source_unzip_dir.joinpath('assets', 'cjk-radicals-supplement-mapping.yml').rename(path_define.ark_pixel_glyphs_dir.joinpath('cjk-radicals-supplement-mapping.yml'))
source_unzip_dir.joinpath('assets', 'kangxi-radicals-mapping.yml').rename(path_define.ark_pixel_glyphs_dir.joinpath('kangxi-radicals-mapping.yml'))
source_unzip_dir.joinpath('assets', 'mappings').rename(path_define.mappings_dir)

if source_unzip_dir.exists():
shutil.rmtree(source_unzip_dir)
Expand Down

0 comments on commit a72fe0b

Please sign in to comment.