From afe6cb5361c8977beabb1b7e053eac14ec5f343f Mon Sep 17 00:00:00 2001 From: TakWolf Date: Sun, 7 Jul 2024 17:32:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/build.py | 2 +- tools/build_www.py | 2 +- tools/format.py | 7 +++++++ tools/services/check_service.py | 0 tools/services/font_service.py | 4 ++-- tools/services/format_service.py | 0 6 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 tools/format.py create mode 100644 tools/services/check_service.py create mode 100644 tools/services/format_service.py diff --git a/tools/build.py b/tools/build.py index d623609e..118fda9d 100644 --- a/tools/build.py +++ b/tools/build.py @@ -28,7 +28,7 @@ def main(): dump_service.apply_fallback(fallback_config) design_context = DesignContext.load(font_config, path_define.patch_glyphs_dir) - design_context.standardized() + design_context.format_glyphs() design_context.fallback(DesignContext.load(font_config, path_define.ark_pixel_glyphs_dir)) design_context.fallback(DesignContext.load(font_config, path_define.fallback_glyphs_dir)) for width_mode in configs.width_modes: diff --git a/tools/build_www.py b/tools/build_www.py index 2dd24bd1..b19834a0 100644 --- a/tools/build_www.py +++ b/tools/build_www.py @@ -22,7 +22,7 @@ def main(): dump_service.apply_fallback(fallback_config) design_context = DesignContext.load(font_config, path_define.patch_glyphs_dir) - design_context.standardized() + design_context.format_glyphs() design_context.fallback(DesignContext.load(font_config, path_define.ark_pixel_glyphs_dir)) design_context.fallback(DesignContext.load(font_config, path_define.fallback_glyphs_dir)) for width_mode in configs.width_modes: diff --git a/tools/format.py b/tools/format.py new file mode 100644 index 00000000..a494114e --- /dev/null +++ b/tools/format.py @@ -0,0 +1,7 @@ + +def main(): + pass + + +if __name__ == '__main__': + main() diff --git a/tools/services/check_service.py b/tools/services/check_service.py new file mode 100644 index 00000000..e69de29b diff --git a/tools/services/font_service.py b/tools/services/font_service.py index dc96be1e..48cfaa8f 100644 --- a/tools/services/font_service.py +++ b/tools/services/font_service.py @@ -137,7 +137,7 @@ def __init__( self._character_mapping_pool = {} self._glyph_files_pool = {} - def standardized(self): + def format_glyphs(self): root_dir = self.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) @@ -186,7 +186,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): diff --git a/tools/services/format_service.py b/tools/services/format_service.py new file mode 100644 index 00000000..e69de29b