Skip to content

Commit

Permalink
代码整理
Browse files Browse the repository at this point in the history
  • Loading branch information
TakWolf committed Jul 7, 2024
1 parent 370a5d1 commit 216d6a5
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def main():
font_configs = {font_size: FontConfig.load(font_size) for font_size in configs.font_sizes}
for font_size, font_config in font_configs.items():
design_context = DesignContext.load(font_config)
design_context.standardized()
design_context.format_glyph_files()
for width_mode in configs.width_modes:
font_context = FontContext(design_context, width_mode)
for font_format in itertools.chain(configs.font_formats, configs.font_collection_formats):
Expand Down
2 changes: 1 addition & 1 deletion tools/build_www.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def main():
font_configs = {font_size: FontConfig.load(font_size) for font_size in configs.font_sizes}
for font_config in font_configs.values():
design_context = DesignContext.load(font_config)
design_context.standardized()
design_context.format_glyph_files()
for width_mode in configs.width_modes:
font_context = FontContext(design_context, width_mode)
font_context.make_fonts('woff2')
Expand Down
2 changes: 1 addition & 1 deletion tools/format_glyphs.py → tools/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def main():
for font_size in configs.font_sizes:
font_config = FontConfig.load(font_size)
design_context = DesignContext.load(font_config)
design_context.standardized()
design_context.format_glyph_files()


if __name__ == '__main__':
Expand Down
Empty file added tools/services/check_service.py
Empty file.
4 changes: 2 additions & 2 deletions tools/services/font_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def __init__(
self._character_mapping_pool = {}
self._glyph_files_pool = {}

def standardized(self):
def format_glyph_files(self):
root_dir = path_define.glyphs_dir.joinpath(str(self.font_config.font_size))
for width_mode_dir_name, code_point_registry in self._glyph_file_registry.items():
width_mode_dir = root_dir.joinpath(width_mode_dir_name)
Expand Down Expand Up @@ -178,7 +178,7 @@ def standardized(self):
file_dir.mkdir(parents=True, exist_ok=True)
glyph_file.file_path.rename(file_path)
glyph_file.file_path = file_path
logger.info("Standardize glyph file path: '%s'", glyph_file.file_path)
logger.info("Format glyph file path: '%s'", glyph_file.file_path)

for file_dir, _, _ in root_dir.walk(top_down=False):
if fs_util.is_empty_dir(file_dir):
Expand Down
Empty file.

0 comments on commit 216d6a5

Please sign in to comment.