Skip to content

Commit

Permalink
调整 mapping 文件目录
Browse files Browse the repository at this point in the history
  • Loading branch information
TakWolf committed Nov 25, 2024
1 parent 824dc6d commit 1962f6f
Show file tree
Hide file tree
Showing 5 changed files with 12 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": "75f8b5021ec06f5049bb2fc6ebc7adcdf16a812e",
"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/75f8b5021ec06f5049bb2fc6ebc7adcdf16a812e.zip"
}
6 changes: 4 additions & 2 deletions tools/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ 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.ark_pixel_mappings_dir.joinpath('0370-03FF-Greek-and-Coptic.yml')),
glyph_mapping_util.load_mapping(path_define.ark_pixel_mappings_dir.joinpath('0400-04FF-Cyrillic.yml')),
glyph_mapping_util.load_mapping(path_define.ark_pixel_mappings_dir.joinpath('2E80-2EFF-CJK-Radicals-Supplement.yml')),
glyph_mapping_util.load_mapping(path_define.ark_pixel_mappings_dir.joinpath('2F00-2FDF-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')
ark_pixel_mappings_dir = cache_dir.joinpath('ark-pixel-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.ark_pixel_mappings_dir.exists():
shutil.rmtree(path_define.ark_pixel_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.ark_pixel_mappings_dir)

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

0 comments on commit 1962f6f

Please sign in to comment.