Skip to content

Commit

Permalink
[Update] オプションを変更
Browse files Browse the repository at this point in the history
  • Loading branch information
omonomo committed Aug 13, 2024
1 parent 8740462 commit 0b46db6
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 36 deletions.
9 changes: 5 additions & 4 deletions calt_table_maker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -574,11 +574,10 @@ calt_table_maker_help()
echo " -x Cleaning temporary files" # 一時作成ファイルの消去のみ
echo " -l Leave (do NOT remove) temporary files"
echo " -n number Set glyph number of \"A moved left\""
echo " -S Don't make calt settings for latin characters"
echo " -k Don't make calt settings for latin characters"
echo " -b Make kerning settings for basic latin characters only"
echo " -O Enable force optimization process"
echo " -o Enable optimization process"
exit 0
}

# メイン ||||||||||||||||||||||||||||||||||||||||
Expand All @@ -588,11 +587,12 @@ echo "- GSUB table [calt, LookupType 6] maker -"
echo

# Get options
while getopts hxln:SbOo OPT
while getopts hxln:kbOo OPT
do
case "${OPT}" in
"h" )
calt_table_maker_help
exit 0
;;
"x" )
echo "Option: Cleaning temporary files"
Expand All @@ -609,7 +609,7 @@ do
glyphNo_flag="true"
glyphNo="${OPTARG}"
;;
"S" )
"k" )
echo "Option: Don't make calt settings for latin characters"
symbol_only_flag="true"
;;
Expand All @@ -626,6 +626,7 @@ do
optimize_mode="optional"
;;
* )
calt_table_maker_help
exit 1
;;
esac
Expand Down
8 changes: 4 additions & 4 deletions font_generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ font_generator_help()
echo " -l Leave (do NOT remove) temporary files"
echo " -N string Set fontfamily (\"string\")"
echo " -n string Set fontfamily suffix (\"string\")"
echo " -L Set the ratio of hankaku to zenkaku characters to 9:16"
echo " -w Set the ratio of hankaku to zenkaku characters to 9:16"
echo " -Z Disable visible zenkaku space"
echo " -z Disable visible hankaku space"
echo " -u Disable zenkaku hankaku underline"
Expand All @@ -393,15 +393,15 @@ font_generator_help()
echo " -d Enable draft mode (skip time-consuming processes)"
echo " -P End just before patching"
echo " -p Run font patch only"
exit 0
}

# Get options
while getopts hVxf:vlN:n:LZzubtOsceoSdPp OPT
while getopts hVxf:vlN:n:wZzubtOsceoSdPp OPT
do
case "${OPT}" in
"h" )
font_generator_help
exit 0
;;
"V" )
exit 0
Expand Down Expand Up @@ -432,7 +432,7 @@ do
echo "Option: Set fontfamily suffix: ${OPTARG}"
font_familyname_suffix=${OPTARG// /}
;;
"L" )
"w" )
echo "Option: Set the ratio of hankaku to zenkaku characters to 9:16"
loose_flag="true"
hankaku_width=${hankaku_width_Loose} # 半角文字幅
Expand Down
2 changes: 1 addition & 1 deletion make_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# 通常版、Loose 版の両方を一度に生成させるプログラム

sh run_ff_ttx.sh -FLl -N "CyroitLoose"
sh run_ff_ttx.sh -Fwl -N "CyroitLoose"
sh run_ff_ttx.sh -Fr

exit 0
37 changes: 19 additions & 18 deletions run_ff_ttx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ option_format_fg() { # font_generator 用のオプションを整形 (戻り値:
if [ "${leaving_tmp_flag}" = "true" ]; then # 引数に l はないが、一時作成ファイルを残す場合
opt="${opt}l"
fi
if [ "${loose_flag}" = "true" ]; then # 引数に L はないが、Loose 版にする場合
opt="${opt}L"
if [ "${loose_flag}" = "true" ]; then # 引数に w はないが、Loose 版にする場合
opt="${opt}w"
fi
if [ "${draft_flag}" = "true" ]; then # 引数に d はないが、下書きモードで処理する場合
opt="${opt}d"
Expand All @@ -74,26 +74,26 @@ option_format_tm() { # table_modificator 用のオプションを整形 (戻り
local opt # 整形前のオプション
local leaving_tmp_flag # 一時作成ファイルを残すか
local loose_flag # Loose 版にするか
local reuse_list_flag # 作成済みのリストを使用するか
local symbol_only_flag # カーニング設定を記号、桁区切りのみにするか
local reuse_list_flag # 作成済みのリストを使用するか
opt="${2}"
leaving_tmp_flag="${3}"
loose_flag="${4}"
reuse_list_flag="${5}"
symbol_only_flag="${6}"
symbol_only_flag="${5}"
reuse_list_flag="${6}"

if [ "${leaving_tmp_flag}" != "false" ]; then # -l オプションか 引数に l がある場合
opt="${opt}l"
fi
if [ "${loose_flag}" != "false" ]; then # -L オプションか 引数に L がある場合
opt="${opt}L"
if [ "${loose_flag}" != "false" ]; then # -w オプションか 引数に w がある場合
opt="${opt}w"
fi
if [ "${symbol_only_flag}" != "false" ]; then # -k オプションがある場合
opt="${opt}k"
fi
if [ "${reuse_list_flag}" != "false" ]; then # -r オプションがある場合
opt="${opt}r"
fi
if [ "${symbol_only_flag}" != "false" ]; then # -S オプションがある場合
opt="${opt}S"
fi
eval "${1}=\${opt}" # 戻り値を入れる変数名を1番目の引数に指定する
}

Expand Down Expand Up @@ -121,26 +121,26 @@ forge_ttx_help()
echo " -l Leave (do NOT remove) temporary files"
echo " -N string Set fontfamily (\"string\")"
echo " -n string Set fontfamily suffix (\"string\")"
echo " -L Set the ratio of hankaku to zenkaku characters to 9:16"
echo " -S Don't make calt settings for latin characters"
echo " -w Set the ratio of hankaku to zenkaku characters to 9:16"
echo " -k Don't make calt settings for latin characters"
echo " -r Reuse an existing list"
echo " -d Draft mode (skip time-consuming processes)" # グリフ変更の確認用 (最後は通常モードで確認すること)
echo " -C End just before editing calt feature" # caltの編集・確認を繰り返す時用にcalt適用前のフォントを作成する
echo " -p Run calt patch only" # -C の続きを実行
echo " -F Complete Mode (generate finished fonts)" # 完成品作成
exit 0
}

echo
echo "*** FontForge and TTX runner ***"
echo

# オプションを取得
while getopts hxlN:n:LSrdCpF OPT
while getopts hxlN:n:wkrdCpF OPT
do
case "${OPT}" in
"h" )
forge_ttx_help
exit 0
;;
"x" )
echo "Option: Cleaning temporary files"
Expand All @@ -160,11 +160,11 @@ do
echo "Option: Set fontfamily suffix: ${OPTARG}"
font_familyname_suffix=${OPTARG// /}
;;
"L" )
"w" )
echo "Option: Set the ratio of hankaku to zenkaku characters to 9:16"
loose_flag="true"
;;
"S" )
"k" )
echo "Option: Don't make calt settings for latin characters"
symbol_only_flag="true"
;;
Expand Down Expand Up @@ -204,6 +204,7 @@ do
table_modify_flag="true"
;;
* )
forge_ttx_help
exit 1
;;
esac
Expand All @@ -223,7 +224,7 @@ if [ "${mode}" != "-p" ]; then # -p オプション以外は引数を取得
exit 1
elif [ "${S}" = "l" ]; then # l が含まれていれば一時作成ファイルを残す (-l オプションと区別)
leaving_tmp_flag="true_arg"
elif [ "${S}" = "L" ]; then # L が含まれていれば Loose 版にする (-L オプションと区別)
elif [ "${S}" = "w" ]; then # w が含まれていれば Loose 版にする (-w オプションと区別)
loose_flag="true_arg"
elif [ "${S}" = "d" ]; then # d が含まれていれば下書きモードで処理 (-d オプションと区別)
draft_flag="true_arg"
Expand Down Expand Up @@ -310,7 +311,7 @@ case ${mode} in
"-F" ) opt_tm="o" ;;
* ) opt_tm="b" ;;
esac
option_format_tm opt_tm "${opt_tm}" "${leaving_tmp_flag}" "${loose_flag}" "${reuse_list_flag}" "${symbol_only_flag}"
option_format_tm opt_tm "${opt_tm}" "${leaving_tmp_flag}" "${loose_flag}" "${symbol_only_flag}" "${reuse_list_flag}"
if [ -n "${opt_tm}" ]; then
sh table_modificator.sh -"${opt_tm}" -N "${font_familyname}${font_familyname_suffix}"
else
Expand Down
17 changes: 9 additions & 8 deletions table_modificator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ option_format_cm() { # calt_table_maker 用のオプションを整形 (戻り
if [ "${leaving_tmp_flag}" != "false" ]; then # -l オプションがある場合
opt="${opt}l"
fi
if [ "${symbol_only_flag}" != "false" ]; then # -S オプションがある場合
opt="${opt}S"
if [ "${symbol_only_flag}" != "false" ]; then # -k オプションがある場合
opt="${opt}k"
fi
if [ "${basic_only_flag}" != "false" ]; then # -b オプションがある場合
opt="${opt}b"
Expand Down Expand Up @@ -110,8 +110,8 @@ table_modificator_help()
echo " -x Cleaning temporary files" # 一時作成ファイルの消去のみ
echo " -l Leave (do NOT remove) temporary files"
echo " -N string Set fontfamily (\"string\")"
echo " -L Set the ratio of hankaku to zenkaku characters to 9:16"
echo " -S Don't make calt settings for latin characters"
echo " -w Set the ratio of hankaku to zenkaku characters to 9:16"
echo " -k Don't make calt settings for latin characters"
echo " -b Make kerning settings for basic Latin characters only"
echo " -o Enable optimization process when make kerning settings"
echo " -r Reuse an existing list"
Expand All @@ -120,19 +120,19 @@ table_modificator_help()
echo " -t Disable edit other tables"
echo " -C End just before editing calt feature"
echo " -p Run calt patch only"
exit 0
}

echo
echo "= Font tables Modificator ="
echo

# Get options
while getopts hxlN:LSbormgtCp OPT
while getopts hxlN:wkbormgtCp OPT
do
case "${OPT}" in
"h" )
table_modificator_help
exit 0
;;
"x" )
echo "Option: Cleaning temporary files"
Expand All @@ -149,12 +149,12 @@ do
echo "Option: Set fontfamily: ${OPTARG}"
font_familyname=${OPTARG// /}
;;
"L" )
"w" )
echo "Option: Set the ratio of hankaku to zenkaku characters to 9:16"
loose_flag="true"
hankaku_width="${hankaku_width_Loose}"
;;
"S" )
"k" )
echo "Option: Don't make calt settings for latin characters"
symbol_only_flag="true"
;;
Expand Down Expand Up @@ -203,6 +203,7 @@ do
calt_insert_flag="true"
;;
* )
table_modificator_help
exit 1
;;
esac
Expand Down
3 changes: 2 additions & 1 deletion uvs_table_maker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ uvs_table_maker_help()
echo " -x Cleaning temporary files" # 一時作成ファイルの消去のみ
echo " -l Leave (do NOT remove) temporary files"
echo " -N string Set fontfamily (\"string\")"
exit 0
}

echo
Expand All @@ -62,6 +61,7 @@ do
case "${OPT}" in
"h" )
uvs_table_maker_help
exit 0
;;
"x" )
echo "Option: Cleaning temporary files"
Expand All @@ -77,6 +77,7 @@ do
font_familyname=${OPTARG// /}
;;
* )
uvs_table_maker_help
exit 1
;;
esac
Expand Down

0 comments on commit 0b46db6

Please sign in to comment.