Skip to content

Commit

Permalink
[Fix] find のオプションの順番を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
omonomo committed Oct 9, 2024
1 parent 70414ee commit bd41d86
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion calt_table_maker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ done
echo

if [ "${glyphNo_flag}" = "false" ]; then
gsubList_txt=$(find . -name "${gsubList}.txt" -maxdepth 1 | head -n 1)
gsubList_txt=$(find . -maxdepth 1 -name "${gsubList}.txt" | head -n 1)
if [ -n "${gsubList_txt}" ]; then # gsubListがあり、
echo "Found GSUB List"
caltNo=$(grep -m 1 'Substitution in="A"' "${gsubList}.txt")
Expand Down
6 changes: 3 additions & 3 deletions font_generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ font_version="0.1.0"
vendor_id="PfEd"

version="version"
version_txt=$(find . -name "${version}.txt" -maxdepth 1 | head -n 1)
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
Expand Down Expand Up @@ -16920,7 +16920,7 @@ if [ "${patch_only_flag}" = "false" ]; then
fi

# ファイル名を変更
find . -not -name "*.*.ttf" -maxdepth 1 | \
find . -maxdepth 1 -not -name "*.*.ttf" | \
grep -e "${font_familyname}${font_familyname_suffix}-.*\.ttf$" | while read line
do
style_ttf=${line#*-}; style=${style_ttf%%.ttf}
Expand All @@ -16932,7 +16932,7 @@ fi

# パッチ適用
if [ "${patch_flag}" = "true" ]; then
find . -name "${font_familyname}-*.nopatch.ttf" -maxdepth 1 | while read line
find . -maxdepth 1 -name "${font_familyname}-*.nopatch.ttf" | while read line
do
font_ttf=$(basename ${line})
$fontforge_command -script ${tmpdir}/${font_patcher} \
Expand Down
4 changes: 2 additions & 2 deletions run_ff_ttx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ symbol_only_flag="false" # カーニング設定を記号、桁区切りのみ
font_version="0.1.0"

version="version"
version_txt=$(find . -name "${version}.txt" -maxdepth 1 | head -n 1)
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
Expand Down Expand Up @@ -338,7 +338,7 @@ if [ "${mode}" = "-F" ]; then
mv -f ${font_familyname}${font_familyname_suffix}*.ttf "${build_fonts_dir}/${font_familyname}/${font_familyname_suffix}/."
fi
# パッチ未適用のフォントを除外して移動
find . -not -name "*.nopatch.ttf" -maxdepth 1 | \
find . -maxdepth 1 -not -name "*.nopatch.ttf" | \
grep -e "${font_familyname}.*\.ttf$" | while read line
do
mv -f "${line}" "${build_fonts_dir}/${font_familyname}/."
Expand Down
24 changes: 12 additions & 12 deletions table_modificator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,22 +213,22 @@ echo
# ttxファイルを削除、パッチのみの場合フォントをリネームして再利用
rm -f ${font_familyname}*.ttx ${font_familyname}*.ttx.bak
if [ "${patch_only_flag}" = "true" ]; then
find . -name "${font_familyname}*.orig.ttf" -maxdepth 1 | while read P
find . -maxdepth 1 -name "${font_familyname}*.orig.ttf" | while read P
do
mv -f "$P" "${P%%.orig.ttf}.ttf"
done
fi

# フォントがあるかチェック
fontName_ttf=$(find . -name "${font_familyname}*.ttf" -maxdepth 1 | head -n 1)
fontName_ttf=$(find . -maxdepth 1 -name "${font_familyname}*.ttf" | head -n 1)
if [ -z "${fontName_ttf}" ]; then
echo "Error: ${font_familyname} not found" >&2
exit 1
fi

# cmap GSUB 以外のテーブル更新 ----------
if [ "${other_flag}" = "true" ]; then
find . -not -name "*.*.ttf" -maxdepth 1 | \
find . -maxdepth 1 -not -name "*.*.ttf" | \
grep -e "${font_familyname}.*\.ttf$" | while read P
do
ttx -t name -t head -t OS/2 -t post -t hmtx "$P" # フォントスタイル判定のため、name テーブルも取得
Expand Down Expand Up @@ -283,7 +283,7 @@ if [ "${other_flag}" = "true" ]; then
rm -f ${font_familyname}*.orig.ttf
rm -f ${font_familyname}*.ttx.bak

find . -not -name "*.*.ttx" -maxdepth 1 | \
find . -maxdepth 1 -not -name "*.*.ttx" | \
grep -e "${font_familyname}.*\.ttx$" | while read P
do
mv "$P" "${P%%.ttx}.others.ttx"
Expand All @@ -295,7 +295,7 @@ if [ "${cmap_flag}" = "true" ]; then
if [ "${reuse_list_flag}" = "false" ]; then
rm -f ${cmapList}.txt
fi
cmaplist_txt=$(find . -name "${cmapList}.txt" -maxdepth 1 | head -n 1)
cmaplist_txt=$(find . -maxdepth 1 -name "${cmapList}.txt" | head -n 1)
if [ -z "${cmaplist_txt}" ]; then # cmapListが無ければ作成
if [ "${leaving_tmp_flag}" = "true" ]; then
./uvs_table_maker.sh -l -N "${font_familyname}"
Expand All @@ -304,7 +304,7 @@ if [ "${cmap_flag}" = "true" ]; then
fi
fi

find . -not -name "*.*.ttf" -maxdepth 1 | \
find . -maxdepth 1 -not -name "*.*.ttf" | \
grep -e "${font_familyname}.*\.ttf$" | while read P
do
ttx -t cmap "$P"
Expand All @@ -321,7 +321,7 @@ if [ "${cmap_flag}" = "true" ]; then
rm -f ${font_familyname}*.orig.ttf
rm -f ${font_familyname}*.ttx.bak

find . -not -name "*.*.ttx" -maxdepth 1 | \
find . -maxdepth 1 -not -name "*.*.ttx" | \
grep -e "${font_familyname}.*\.ttx$" | while read P
do
mv "$P" "${P%%.ttx}.cmap.ttx"
Expand All @@ -334,7 +334,7 @@ if [ "${gsub_flag}" = "true" ]; then # caltListを作り直す場合は今ある
rm -f ${caltListName}*.txt
fi

find . -not -name "*.*.ttf" -maxdepth 1 | \
find . -maxdepth 1 -not -name "*.*.ttf" | \
grep -e "${font_familyname}.*\.ttf$" | while read P
do
calt_ok_flag="true" # calt不対応の場合は後でfalse
Expand All @@ -347,22 +347,22 @@ if [ "${gsub_flag}" = "true" ]; then # caltListを作り直す場合は今ある
echo "Compatible with calt feature." # フォントがcaltフィーチャに対応していた場合
# caltテーブル加工用ファイルの作成
if [ "${calt_insert_flag}" = "true" ]; then
gsublist_txt=$(find . -name "${gsubList}.txt" -maxdepth 1 | head -n 1)
gsublist_txt=$(find . -maxdepth 1 -name "${gsubList}.txt" | head -n 1)
if [ -z "${gsublist_txt}" ]; then # gsubListが無ければ作成(calt_table_maker で使用するため)
if [ "${leaving_tmp_flag}" = "true" ]; then
./uvs_table_maker.sh -l -N "${font_familyname}"
else
./uvs_table_maker.sh -N "${font_familyname}"
fi
fi
caltlist_txt=$(find . -name "${caltListName}*.txt" -maxdepth 1 | head -n 1)
caltlist_txt=$(find . -maxdepth 1 -name "${caltListName}*.txt" | head -n 1)
if [ -z "${caltlist_txt}" ]; then # caltListが無ければ作成
option_format_cm opt_fg "" "${leaving_tmp_flag}" "${symbol_only_flag}" "${basic_only_flag}" "${optimize_flag}"
./calt_table_maker.sh -"${opt_fg}"
fi
# フィーチャリストを変更
sed -i.bak -e 's,FeatureTag value="zero",FeatureTag value="calt",' "${P%%.ttf}.ttx" # caltダミー(zero)を変更
find . -name "${caltListName}*.txt" -maxdepth 1 | while read line # caltList(caltルックアップ)の数だけループ
find . -maxdepth 1 -name "${caltListName}*.txt" | while read line # caltList(caltルックアップ)の数だけループ
do
sed -i.bak -e "/Lookup index=\"${lookupIndex_calt}\"/{n;d;}" "${P%%.ttf}.ttx" # Lookup index="${lookupIndex_calt}"〜の中を削除
sed -i.bak -e "/Lookup index=\"${lookupIndex_calt}\"/{n;d;}" "${P%%.ttf}.ttx"
Expand Down Expand Up @@ -447,7 +447,7 @@ if [ "${gsub_flag}" = "true" ]; then # caltListを作り直す場合は今ある
fi
rm -f ${font_familyname}*.ttx.bak

find . -not -name "*.*.ttx" -maxdepth 1 | \
find . -maxdepth 1 -not -name "*.*.ttx" | \
grep -e "${font_familyname}.*\.ttx$" | while read P
do
mv "$P" "${P%%.ttx}.GSUB.ttx"
Expand Down
2 changes: 1 addition & 1 deletion uvs_table_maker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ if [ -z "${fromFontName_ttf}" ]; then
echo "Error: ${fromFontName} not found" >&2
exit 1
fi
toFontName_ttf=$(find . -name "${toFontName}.ttf" -maxdepth 1 | head -n 1)
toFontName_ttf=$(find . -maxdepth 1 -name "${toFontName}.ttf" | head -n 1)
if [ -z "${toFontName_ttf}" ]; then
echo "Error: ${toFontName} not found" >&2
exit 1
Expand Down

0 comments on commit bd41d86

Please sign in to comment.