From e52770ea4d2147a3ee140c8e67259ef3ead1d8af Mon Sep 17 00:00:00 2001 From: omonomo Date: Sun, 13 Oct 2024 23:26:59 +0900 Subject: [PATCH] =?UTF-8?q?[Update]=20=E8=A8=AD=E5=AE=9A=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=81=8B=E3=82=89=E8=AA=AD=E3=81=BF=E8=BE=BC?= =?UTF-8?q?=E3=82=80=E9=A0=85=E7=9B=AE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- font_generator.sh | 27 +++++++++++++++++++++------ run_ff_ttx.sh | 23 ++++++++++++++--------- settings.txt | 7 +++++++ table_modificator.sh | 8 ++++++++ uvs_table_maker.sh | 8 ++++++++ 5 files changed, 58 insertions(+), 15 deletions(-) diff --git a/font_generator.sh b/font_generator.sh index 5629b89..c59187d 100755 --- a/font_generator.sh +++ b/font_generator.sh @@ -359,22 +359,37 @@ settings_txt=$(find . -maxdepth 1 -name "${settings}.txt" | head -n 1) if [ -n "${settings_txt}" ]; then S=$(grep -m 1 "^version=" "${settings_txt}") # フォントバージョン if [ -n "${S}" ]; then font_version="${S#version=}"; fi - S=$(grep -m 1 "^moveY_powerline=" "${settings_txt}") # Powerline Y座標補正値 - if [ -n "${S}" ]; then y_pos_pl_revise="${S#moveY_powerline=}"; fi - S=$(grep -m 1 "^scaleY_powerline=" "${settings_txt}") # Powerline Y座標拡大率 - if [ -n "${S}" ]; then height_scale_pl_revise="${S#scaleY_powerline=}"; fi - S=$(grep -m 1 "^scale_decimal=" "${settings_txt}") # 小数拡大率 - if [ -n "${S}" ]; then scale_calt_decimal="${S#scale_decimal=}"; fi + + S=$(grep -m 1 "font_familyname=" "${settings_txt}") # フォントファミリー名 + if [ -n "${S}" ]; then font_familyname="${S#font_familyname=}"; fi + + S=$(grep -m 1 "font_familyname_suffix=" "${settings_txt}") # フォントファミリー名接尾語 + if [ -n "${S}" ]; then font_familyname_suffix="${S#font_familyname_suffix=}"; fi + + S=$(grep -m 1 "vendor_id=" "${settings_txt}") # メーカー ID + if [ -n "${S}" ]; then vendor_id="${S#vendor_id=}"; fi + S=$(grep "^copyright=" "${settings_txt}") # 著作権 if [ -n "${S}" ]; then copyright="${S//copyright=/}"; copyright="${copyright// /\\n\\n\" + \"}\n\n"; fi + S=$(grep -m 1 "^copyright_nerd_fonts=" "${settings_txt}") # 著作権 (Nerd fonts) if [ -n "${S}" ]; then copyright_nerd_fonts="${S#copyright_nerd_fonts=}\n\n"; fi + S=$(grep -m 1 "^copyright_license=" "${settings_txt}") # ライセンス if [ -n "${S}" ]; then copyright_license="${S#copyright_license=}"; fi + + S=$(grep -m 1 "^moveY_powerline=" "${settings_txt}") # Powerline Y座標補正値 + if [ -n "${S}" ]; then y_pos_pl_revise="${S#moveY_powerline=}"; fi + + S=$(grep -m 1 "^scaleY_powerline=" "${settings_txt}") # Powerline Y座標拡大率 + if [ -n "${S}" ]; then height_scale_pl_revise="${S#scaleY_powerline=}"; fi + + S=$(grep -m 1 "^scale_decimal=" "${settings_txt}") # 小数拡大率 + if [ -n "${S}" ]; then scale_calt_decimal="${S#scale_decimal=}"; fi fi # Powerline の Y座標移動量 diff --git a/run_ff_ttx.sh b/run_ff_ttx.sh index 9be2e42..8f9ed21 100755 --- a/run_ff_ttx.sh +++ b/run_ff_ttx.sh @@ -39,15 +39,6 @@ symbol_only_flag="false" # カーニング設定を記号、桁区切りのみ font_version="0.1.0" -version="version" -version_txt=$(find . -maxdepth 1 -name "${version}.txt" | head -n 1) -if [ -n "${version_txt}" ]; then - font_v=$(head -n 1 < ${version_txt}) - if [ -n "${font_v}" ]; then - font_version=${font_v} - fi -fi - option_format_fg() { # font_generator 用のオプションを整形 (戻り値: 整形したオプション) local opt # 整形前のオプション local leaving_tmp_flag # 一時作成ファイルを残すか @@ -130,6 +121,20 @@ forge_ttx_help() echo " -F Complete Mode (generate finished fonts)" # 完成品作成 } +# 設定読み込み +settings="settings" # 設定ファイル名 +settings_txt=$(find . -maxdepth 1 -name "${settings}.txt" | head -n 1) +if [ -n "${settings_txt}" ]; then + S=$(grep -m 1 "^version=" "${settings_txt}") # フォントバージョン + if [ -n "${S}" ]; then font_version="${S#version=}"; fi + + S=$(grep -m 1 "font_familyname=" "${settings_txt}") # フォントファミリー名 + if [ -n "${S}" ]; then font_familyname="${S#font_familyname=}"; fi + + S=$(grep -m 1 "font_familyname_suffix=" "${settings_txt}") # フォントファミリー名接尾語 + if [ -n "${S}" ]; then font_familyname_suffix="${S#font_familyname_suffix=}"; fi +fi + echo echo "*** FontForge and TTX runner ***" echo diff --git a/settings.txt b/settings.txt index 84c25f4..4778ce6 100755 --- a/settings.txt +++ b/settings.txt @@ -1,6 +1,13 @@ # フォントのバージョン version=3.2.4b +# フォント名 +font_familyname=Cyroit +font_familyname_suffix= + +# メーカー ID +vendor_id=PfEd + # 著作権 copyright=Copyright (c) 2023 omonomo copyright=[Inconsolata]\nCopyright 2006 The Inconsolata Project Authors (https://github.com/cyrealtype/Inconsolata) diff --git a/table_modificator.sh b/table_modificator.sh index 7155294..a0b8726 100755 --- a/table_modificator.sh +++ b/table_modificator.sh @@ -122,6 +122,14 @@ table_modificator_help() echo " -p Run calt patch only" } +# 設定読み込み +settings="settings" # 設定ファイル名 +settings_txt=$(find . -maxdepth 1 -name "${settings}.txt" | head -n 1) +if [ -n "${settings_txt}" ]; then + S=$(grep -m 1 "font_familyname=" "${settings_txt}") # フォントファミリー名 + if [ -n "${S}" ]; then font_familyname="${S#font_familyname=}"; fi +fi + echo echo "= Font tables Modificator =" echo diff --git a/uvs_table_maker.sh b/uvs_table_maker.sh index 2f8ec47..b66c8d4 100755 --- a/uvs_table_maker.sh +++ b/uvs_table_maker.sh @@ -51,6 +51,14 @@ uvs_table_maker_help() echo " -N string Set fontfamily (\"string\")" } +# 設定読み込み +settings="settings" # 設定ファイル名 +settings_txt=$(find . -maxdepth 1 -name "${settings}.txt" | head -n 1) +if [ -n "${settings_txt}" ]; then + S=$(grep -m 1 "font_familyname=" "${settings_txt}") # フォントファミリー名 + if [ -n "${S}" ]; then font_familyname="${S#font_familyname=}"; fi +fi + echo echo "- UVS table [cmap, format 14] maker -" echo