Skip to content

Commit

Permalink
[Update] 演算子の位置調整、平行四辺形のウェイト調整
Browse files Browse the repository at this point in the history
  • Loading branch information
omonomo committed Sep 22, 2023
1 parent 5cfcb70 commit fe7f37f
Showing 1 changed file with 70 additions and 2 deletions.
72 changes: 70 additions & 2 deletions font_generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ address_vert_dh=`expr ${address_vert_X} + 3` # vert置換アドレス ゠
address_vert_mm=`expr ${address_vert_dh} + 18` # vert置換アドレス ㍉
address_vert_kabu=`expr ${address_vert_mm} + 333` # vert置換アドレス ㍿
address_calt=`expr ${address_vert_kabu} + 7` # calt置換アドレス
address_calt_end=`expr ${address_calt} + 103` # calt置換の最終アドレス(右に移動した z)
address_calt_end=`expr ${address_calt} + 104` # calt置換の最終アドレス(上に移動した:)

# フォントバージョンにビルドNo追加
buildNo=`date "+%s"`
Expand Down Expand Up @@ -118,8 +118,12 @@ y_pos_super="273" # 上付きY座標移動量
y_pos_sub="-166" # 下付きY座標移動量
weight_extend_super_sub="12" # ウェイト調整

# 演算子移動量
y_pos_math="-30"

# calt移動量
x_pos_calt="20"
y_pos_calt="60"

# Set path to command
fontforge_command="fontforge"
Expand Down Expand Up @@ -1909,6 +1913,18 @@ while (i < SizeOf(input_list))
Select(0u002d) # -
AddPosSub(lookups[1][0],glyphName)
# 演算子を下に移動
math = [0u002a, 0u002b, 0u002d, 0u003c,\
0u003d, 0u003e, 0u00d7, 0u00f7,\
0u2212, 0u2217, 0u2260]
j = 0
while (j < SizeOf(math))
Select(math[j]);
Move(0,${y_pos_math})
SetWidth(500)
j += 1
endloop
# --------------------------------------------------
# 記号を一部クリア
Expand Down Expand Up @@ -4871,7 +4887,11 @@ while (i < SizeOf(input_list))
Select(0u25a1); Copy() # □
Select(0u25b1); Paste() # ▱
Transform(80, 0, 40, 70, -4000, 10000)
ChangeWeight(16)
if (input_list[i] == "${input_kana_regular}")
ChangeWeight(22)
else
ChangeWeight(24)
endif
CorrectDirection()
SetWidth(1000)
Expand Down Expand Up @@ -4921,6 +4941,16 @@ while (i < SizeOf(input_list))
Select(65552); Clear() # Temporary glyph
# endif
# 演算子を下に移動
math = [0u223c]
j = 0
while (j < SizeOf(math))
Select(math[j]);
Move(0,${y_pos_math})
SetWidth(500)
j += 1
endloop
# --------------------------------------------------
# ボールド仮名等のウェイト調整
Expand Down Expand Up @@ -6264,6 +6294,25 @@ while (i < SizeOf(input_list))
Select(65552); Clear() # Temporary glyph
Select(65553); Clear() # Temporary glyph
# 演算子を下に移動
math = [0u2243, 0u2248, 0u2252]
j = 0
while (j < SizeOf(math))
Select(math[j]);
Move(0,${y_pos_math})
SetWidth(512)
j += 1
endloop
math = [0u226a, 0u226b]
j = 0
while (j < SizeOf(math))
Select(math[j]);
Move(0,${y_pos_math})
SetWidth(1024)
j += 1
endloop
# --------------------------------------------------
# calt 対応 (スロットの確保、後でグリフ上書き)
Expand All @@ -6283,6 +6332,10 @@ while (i < SizeOf(input_list))
j += 1
k += 1
endloop
Select(0u003a); Copy() # :
Select(k); Paste()
k += 1
# endif
# --------------------------------------------------
Expand Down Expand Up @@ -7769,6 +7822,21 @@ while (i < \$argc)
k += 1
endloop
lookupName = "単純置換 (上)"
AddLookup(lookupName, "gsub_single", 0, [], lookups[numlookups - 1])
lookupSub1 = lookupName + "サブテーブル"
AddLookupSubtable(lookupName, lookupSub1)
Select(0u003a); Copy() # :
glyphName = GlyphInfo("Name")
Select(k); Paste()
Move(0, ${y_pos_calt})
SetWidth(512)
AddPosSub(lookupSub0, glyphName) # 中←上
glyphName = GlyphInfo("Name")
Select(0u003a) # :
AddPosSub(lookupSub1, glyphName) # 中→上
k += 1
# calt をスクリプトで扱う方法が分からないので一旦ダミーをセットしてttxで上書きする
lookupName = "'zero' 文脈依存の異体字に後で換える"
AddLookup(lookupName, "gsub_single", 0, [["zero",[["DFLT",["dflt"]]]]], lookups[numlookups - 1])
Expand Down

0 comments on commit fe7f37f

Please sign in to comment.