Skip to content

Commit

Permalink
Update font glyphs for improved readability
Browse files Browse the repository at this point in the history
  • Loading branch information
yuru7 committed Jun 8, 2024
1 parent c60bc8a commit 449dac0
Show file tree
Hide file tree
Showing 6 changed files with 12,422 additions and 1,327 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ BIZ UDゴシックの目に優しく馴染む字形と Inconsolata の癖がな
- BIZ UDゴシック相当の IVS (異体字シーケンス) に対応
- コーディング中に気付きづらい全角スペースの可視化
- 判読性向上のための細かな修正
- チルダ (半角波線) の曲線を強調
- シングルクォート `'` 、ダブルクォート `"` 、バッククォート `` ` `` 、コロン `:` 、セミコロン `;` 、カンマ `,` 、ドット `.` を拡大
- 一部の全角括弧類で位置調整
- チルダ (半角波線) の曲線を強調
- ``' " ` : ; , . + -`` を拡大
- `ぱぴぷぺぽパピプペポ` の半濁点を強調
- `カ力` `エ工` `ロ口` `ー一` `ニ二` `へヘ` `` の区別
- `~〜` の区別のため、波ダッシュ `` を反転
- 文字の調和よりも判読性を優先した、Ricty インスパイアな Discord バリエーション
- `07DZlrz|` の字形を変更
- `カ力` `エ工` `ロ口` `ー一` `ニ二` `へべぺヘベペ` の見分けが付くように特徴付け
- `ぱぴぷぺぽパピプペポ` の半濁点をさらに強調
- 前述の拡大している記号をさらに拡大

## 表示サンプル
Expand Down
51 changes: 34 additions & 17 deletions fontforge_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def generate_font(jp_style, eng_style, merged_style):

# Discord用の調整
if options.get("discord"):
create_discord(eng_font)
create_discord(eng_font, jp_font, jp_style)

# 重複するグリフを削除する
delete_duplicate_glyphs(jp_font, eng_font)
Expand Down Expand Up @@ -319,7 +319,7 @@ def adjust_some_glyph(jp_font, jp_style, eng_font, eng_style):
for glyph_name in [0x002B]:
glyph = eng_font[glyph_name]
scale_glyph(glyph, 1, 1.15)
# 全角チルダを垂直に反転
# 波ダッシュを垂直に反転
tilde = jp_font[0x301C]
inverse_glyph(tilde)
# 英語フォントにカスタムグリフを適用する
Expand All @@ -329,7 +329,7 @@ def adjust_some_glyph(jp_font, jp_style, eng_font, eng_style):
eng_font.mergeFonts(f"{SOURCE_FONTS_DIR}/inconsolata/custom_glyphs-{eng_style}.sfd")
eng_font.selection.none()
# 日本語フォントにカスタムグリフを適用する
# - ぱぴぷぺぽ パピプペポ の半濁点を調整 30%拡大
# - ぱぴぷぺぽ パピプペポ の半濁点を調整 20%拡大
for uni in [
0x3071,
0x3074,
Expand All @@ -344,19 +344,6 @@ def adjust_some_glyph(jp_font, jp_style, eng_font, eng_style):
]:
glyph = jp_font[uni]
glyph.clear()
# - カ力 エ工 ロ口 ー一 ニ二 (カタカナ・漢字) へヘ (ひらがな・カタカナ) 後者のグリフに特徴付け
for uni in [
0x529B,
0x5DE5,
0x53E3,
0x30FC,
0x4E00,
0x4E8C,
0x30D8,
0x30D9,
]:
glyph = jp_font[uni]
glyph.clear()
jp_font.mergeFonts(f"{SOURCE_FONTS_DIR}/biz-ud-gothic/custom_glyphs-{jp_style}.sfd")


Expand Down Expand Up @@ -401,7 +388,7 @@ def inverse_glyph(glyph):
glyph.transform(psMat.translate(0, before_top_y - after_top_y))


def create_discord(eng_font):
def create_discord(eng_font, jp_font, jp_style):
"""Discord用の調整を行う"""
# Discord用の調整
discord_char_list = "07DZlrz|"
Expand Down Expand Up @@ -512,6 +499,36 @@ def create_discord(eng_font):
glyph = eng_font[glyph_name]
scale_glyph(glyph, 1.15, 1.15)

# 日本語フォントにカスタムグリフを適用する
# - ぱぴぷぺぽ パピプペポ の半濁点を調整 30%拡大
# - カタカナ ヘペベ に特徴付け
# - カ力 エ工 ロ口 ー一 ニ二 のグリフに特徴付け
for uni in [
0x3071,
0x3074,
0x3077,
0x307A,
0x307D,
0x30D1,
0x30D4,
0x30D7,
0x30DA,
0x30DD,
0x30D8,
0x30D9,
0x529B,
0x5DE5,
0x53E3,
0x30FC,
0x4E00,
0x4E8C,
]:
glyph = jp_font[uni]
glyph.clear()
jp_font.mergeFonts(
f"{SOURCE_FONTS_DIR}/biz-ud-gothic/custom_glyphs_discord-{jp_style}.sfd"
)


def adjust_em(font):
"""フォントのEMを揃える"""
Expand Down
Loading

0 comments on commit 449dac0

Please sign in to comment.