From 027e24eaa72dcd38a1b24620dd7829018816799e Mon Sep 17 00:00:00 2001 From: TakWolf Date: Wed, 3 Jul 2024 16:52:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E6=97=A0=E6=95=88=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 9 ++----- tools/dump_fonts.py | 16 ------------- tools/make_fallback.py | 16 ------------- tools/make_fonts.py | 35 --------------------------- tools/release_10px_monospaced.py | 38 ------------------------------ tools/release_10px_proportional.py | 38 ------------------------------ tools/release_12px_monospaced.py | 38 ------------------------------ tools/release_12px_proportional.py | 38 ------------------------------ tools/release_8px_monospaced.py | 38 ------------------------------ tools/release_8px_proportional.py | 38 ------------------------------ 10 files changed, 2 insertions(+), 302 deletions(-) delete mode 100644 tools/dump_fonts.py delete mode 100644 tools/make_fallback.py delete mode 100644 tools/make_fonts.py delete mode 100644 tools/release_10px_monospaced.py delete mode 100644 tools/release_10px_proportional.py delete mode 100644 tools/release_12px_monospaced.py delete mode 100644 tools/release_12px_proportional.py delete mode 100644 tools/release_8px_monospaced.py delete mode 100644 tools/release_8px_proportional.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6096ecc9..22e0cd8f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,11 +8,6 @@ jobs: release: permissions: contents: write - strategy: - matrix: - font-size: [8, 10, 12] - width-mode: [monospaced, proportional] - fail-fast: false runs-on: ubuntu-latest steps: - name: Checkout @@ -26,8 +21,8 @@ jobs: python -m pip install pip --upgrade python -m pip install -r requirements.txt - name: Build - run: python -m tools.release_${{ matrix.font-size }}px_${{ matrix.width-mode }} + run: python -m tools.build - name: Release uses: softprops/action-gh-release@v2 with: - files: ./build/releases/fusion-pixel-font-${{ matrix.font-size }}px-${{ matrix.width-mode }}-*.zip + files: ./build/releases/*.zip diff --git a/tools/dump_fonts.py b/tools/dump_fonts.py deleted file mode 100644 index ec4b9403..00000000 --- a/tools/dump_fonts.py +++ /dev/null @@ -1,16 +0,0 @@ -from tools.configs import path_define -from tools.configs.dump import DumpConfig -from tools.services import dump_service -from tools.utils import fs_util - - -def main(): - fs_util.delete_dir(path_define.dump_dir) - - for dump_configs in DumpConfig.load_all().values(): - for dump_config in dump_configs: - dump_service.dump_font(dump_config) - - -if __name__ == '__main__': - main() diff --git a/tools/make_fallback.py b/tools/make_fallback.py deleted file mode 100644 index 6b9d1391..00000000 --- a/tools/make_fallback.py +++ /dev/null @@ -1,16 +0,0 @@ -from tools.configs import path_define -from tools.configs.fallback import FallbackConfig -from tools.services import dump_service -from tools.utils import fs_util - - -def main(): - fs_util.delete_dir(path_define.fallback_glyphs_dir) - - for fallback_configs in FallbackConfig.load_all().values(): - for fallback_config in fallback_configs: - dump_service.apply_fallback(fallback_config) - - -if __name__ == '__main__': - main() diff --git a/tools/make_fonts.py b/tools/make_fonts.py deleted file mode 100644 index 027b9cbe..00000000 --- a/tools/make_fonts.py +++ /dev/null @@ -1,35 +0,0 @@ -import itertools - -from tools import configs -from tools.configs import path_define -from tools.configs.font import FontConfig -from tools.services import publish_service, info_service, template_service, image_service -from tools.services.font_service import DesignContext, FontContext -from tools.utils import fs_util - - -def main(): - fs_util.delete_dir(path_define.outputs_dir) - fs_util.delete_dir(path_define.releases_dir) - - font_configs = FontConfig.load_all() - for font_size, font_config in font_configs.items(): - design_context = DesignContext.load(font_config, path_define.patch_glyphs_dir) - 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: - font_context = FontContext(design_context, width_mode) - for font_format in itertools.chain(configs.font_formats, configs.font_collection_formats): - font_context.make_fonts(font_format) - publish_service.make_release_zip(font_size, width_mode, font_format) - info_service.make_font_info(design_context, width_mode) - info_service.make_alphabet_txt(design_context, width_mode) - template_service.make_alphabet_html(design_context, width_mode) - template_service.make_demo_html(design_context) - image_service.make_preview_image(font_config) - template_service.make_index_html(font_configs) - template_service.make_playground_html(font_configs) - - -if __name__ == '__main__': - main() diff --git a/tools/release_10px_monospaced.py b/tools/release_10px_monospaced.py deleted file mode 100644 index af564697..00000000 --- a/tools/release_10px_monospaced.py +++ /dev/null @@ -1,38 +0,0 @@ -import itertools - -from tools import configs -from tools.configs import path_define -from tools.configs.dump import DumpConfig -from tools.configs.fallback import FallbackConfig -from tools.configs.font import FontConfig -from tools.services import update_service, dump_service, publish_service, info_service -from tools.services.font_service import DesignContext, FontContext - - -def main(): - font_size = 10 - width_mode = 'monospaced' - - update_service.setup_ark_pixel_glyphs() - - for dump_config in DumpConfig.load_all()[font_size]: - dump_service.dump_font(dump_config) - - for fallback_config in FallbackConfig.load_all()[font_size]: - dump_service.apply_fallback(fallback_config) - - font_config = FontConfig.load(font_size) - design_context = DesignContext.load(font_config, path_define.patch_glyphs_dir) - design_context.standardized() - 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)) - font_context = FontContext(design_context, width_mode) - for font_format in itertools.chain(configs.font_formats, configs.font_collection_formats): - font_context.make_fonts(font_format) - publish_service.make_release_zip(font_size, width_mode, font_format) - info_service.make_font_info(design_context, width_mode) - info_service.make_alphabet_txt(design_context, width_mode) - - -if __name__ == '__main__': - main() diff --git a/tools/release_10px_proportional.py b/tools/release_10px_proportional.py deleted file mode 100644 index 723209d5..00000000 --- a/tools/release_10px_proportional.py +++ /dev/null @@ -1,38 +0,0 @@ -import itertools - -from tools import configs -from tools.configs import path_define -from tools.configs.dump import DumpConfig -from tools.configs.fallback import FallbackConfig -from tools.configs.font import FontConfig -from tools.services import update_service, dump_service, publish_service, info_service -from tools.services.font_service import DesignContext, FontContext - - -def main(): - font_size = 10 - width_mode = 'proportional' - - update_service.setup_ark_pixel_glyphs() - - for dump_config in DumpConfig.load_all()[font_size]: - dump_service.dump_font(dump_config) - - for fallback_config in FallbackConfig.load_all()[font_size]: - dump_service.apply_fallback(fallback_config) - - font_config = FontConfig.load(font_size) - design_context = DesignContext.load(font_config, path_define.patch_glyphs_dir) - design_context.standardized() - 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)) - font_context = FontContext(design_context, width_mode) - for font_format in itertools.chain(configs.font_formats, configs.font_collection_formats): - font_context.make_fonts(font_format) - publish_service.make_release_zip(font_size, width_mode, font_format) - info_service.make_font_info(design_context, width_mode) - info_service.make_alphabet_txt(design_context, width_mode) - - -if __name__ == '__main__': - main() diff --git a/tools/release_12px_monospaced.py b/tools/release_12px_monospaced.py deleted file mode 100644 index 3407ef26..00000000 --- a/tools/release_12px_monospaced.py +++ /dev/null @@ -1,38 +0,0 @@ -import itertools - -from tools import configs -from tools.configs import path_define -from tools.configs.dump import DumpConfig -from tools.configs.fallback import FallbackConfig -from tools.configs.font import FontConfig -from tools.services import update_service, dump_service, publish_service, info_service -from tools.services.font_service import DesignContext, FontContext - - -def main(): - font_size = 12 - width_mode = 'monospaced' - - update_service.setup_ark_pixel_glyphs() - - for dump_config in DumpConfig.load_all()[font_size]: - dump_service.dump_font(dump_config) - - for fallback_config in FallbackConfig.load_all()[font_size]: - dump_service.apply_fallback(fallback_config) - - font_config = FontConfig.load(font_size) - design_context = DesignContext.load(font_config, path_define.patch_glyphs_dir) - design_context.standardized() - 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)) - font_context = FontContext(design_context, width_mode) - for font_format in itertools.chain(configs.font_formats, configs.font_collection_formats): - font_context.make_fonts(font_format) - publish_service.make_release_zip(font_size, width_mode, font_format) - info_service.make_font_info(design_context, width_mode) - info_service.make_alphabet_txt(design_context, width_mode) - - -if __name__ == '__main__': - main() diff --git a/tools/release_12px_proportional.py b/tools/release_12px_proportional.py deleted file mode 100644 index a3abe73a..00000000 --- a/tools/release_12px_proportional.py +++ /dev/null @@ -1,38 +0,0 @@ -import itertools - -from tools import configs -from tools.configs import path_define -from tools.configs.dump import DumpConfig -from tools.configs.fallback import FallbackConfig -from tools.configs.font import FontConfig -from tools.services import update_service, dump_service, publish_service, info_service -from tools.services.font_service import DesignContext, FontContext - - -def main(): - font_size = 12 - width_mode = 'proportional' - - update_service.setup_ark_pixel_glyphs() - - for dump_config in DumpConfig.load_all()[font_size]: - dump_service.dump_font(dump_config) - - for fallback_config in FallbackConfig.load_all()[font_size]: - dump_service.apply_fallback(fallback_config) - - font_config = FontConfig.load(font_size) - design_context = DesignContext.load(font_config, path_define.patch_glyphs_dir) - design_context.standardized() - 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)) - font_context = FontContext(design_context, width_mode) - for font_format in itertools.chain(configs.font_formats, configs.font_collection_formats): - font_context.make_fonts(font_format) - publish_service.make_release_zip(font_size, width_mode, font_format) - info_service.make_font_info(design_context, width_mode) - info_service.make_alphabet_txt(design_context, width_mode) - - -if __name__ == '__main__': - main() diff --git a/tools/release_8px_monospaced.py b/tools/release_8px_monospaced.py deleted file mode 100644 index e96da07c..00000000 --- a/tools/release_8px_monospaced.py +++ /dev/null @@ -1,38 +0,0 @@ -import itertools - -from tools import configs -from tools.configs import path_define -from tools.configs.dump import DumpConfig -from tools.configs.fallback import FallbackConfig -from tools.configs.font import FontConfig -from tools.services import update_service, dump_service, publish_service, info_service -from tools.services.font_service import DesignContext, FontContext - - -def main(): - font_size = 8 - width_mode = 'monospaced' - - update_service.setup_ark_pixel_glyphs() - - for dump_config in DumpConfig.load_all()[font_size]: - dump_service.dump_font(dump_config) - - for fallback_config in FallbackConfig.load_all()[font_size]: - dump_service.apply_fallback(fallback_config) - - font_config = FontConfig.load(font_size) - design_context = DesignContext.load(font_config, path_define.patch_glyphs_dir) - design_context.standardized() - 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)) - font_context = FontContext(design_context, width_mode) - for font_format in itertools.chain(configs.font_formats, configs.font_collection_formats): - font_context.make_fonts(font_format) - publish_service.make_release_zip(font_size, width_mode, font_format) - info_service.make_font_info(design_context, width_mode) - info_service.make_alphabet_txt(design_context, width_mode) - - -if __name__ == '__main__': - main() diff --git a/tools/release_8px_proportional.py b/tools/release_8px_proportional.py deleted file mode 100644 index 2c2a3f79..00000000 --- a/tools/release_8px_proportional.py +++ /dev/null @@ -1,38 +0,0 @@ -import itertools - -from tools import configs -from tools.configs import path_define -from tools.configs.dump import DumpConfig -from tools.configs.fallback import FallbackConfig -from tools.configs.font import FontConfig -from tools.services import update_service, dump_service, publish_service, info_service -from tools.services.font_service import DesignContext, FontContext - - -def main(): - font_size = 8 - width_mode = 'proportional' - - update_service.setup_ark_pixel_glyphs() - - for dump_config in DumpConfig.load_all()[font_size]: - dump_service.dump_font(dump_config) - - for fallback_config in FallbackConfig.load_all()[font_size]: - dump_service.apply_fallback(fallback_config) - - font_config = FontConfig.load(font_size) - design_context = DesignContext.load(font_config, path_define.patch_glyphs_dir) - design_context.standardized() - 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)) - font_context = FontContext(design_context, width_mode) - for font_format in itertools.chain(configs.font_formats, configs.font_collection_formats): - font_context.make_fonts(font_format) - publish_service.make_release_zip(font_size, width_mode, font_format) - info_service.make_font_info(design_context, width_mode) - info_service.make_alphabet_txt(design_context, width_mode) - - -if __name__ == '__main__': - main()