Skip to content

Commit

Permalink
Adjustment of option names, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuru7 committed Aug 17, 2024
1 parent 437dc70 commit a583d1e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 20 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ BIZ UDゴシックの優れた機能美はそのままに、調和的で判読

## ビルド

環境:

- fontforge: `20230101` \[[Windows](https://fontforge.org/en-US/downloads/windows/)\] \[[Linux](https://fontforge.org/en-US/downloads/gnulinux/)\]
- Python: `>=3.12`

Expand All @@ -57,6 +59,17 @@ pip install -r requirements.txt
& "C:\Program Files (x86)\FontForgeBuilds\bin\ffpython.exe" .\fontforge_script.py && python3 .\fonttools_script.py
```

### ビルドオプション

`fontforge_script.py` 実行時、以下のオプションを指定できます。

- `--35`: 半角3:全角5 の幅にする
- `--jpdoc`: 日本語文書頻出記号を全角にする
- `--nerd-font`: Nerd Fonts を追加合成する
- `--liga`: リガチャを加える
- `--hidden-zenkaku-space`: 全角スペース可視化を無効化
- `--dot-zero`: `0` をドットゼロにする

## ライセンス

SIL OPEN FONT LICENSE Version 1.1 が適用され、商用・非商用問わず利用可能です。
Expand Down
4 changes: 2 additions & 2 deletions build.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[DEFAULT]
VERSION = v2.0.0-beta1
VERSION = v2.0.0
FONT_NAME = UDEV Gothic
JP_FONT = fontforge_export_BIZUDGothic-{style}.ttf
ENG_FONT = JetBrainsMonoNL-{style}.ttf
Expand All @@ -15,7 +15,7 @@ JPDOC_STR = JPDOC
DOT_ZERO_STR = DZ
NERD_FONTS_STR = NF
LIGA_STR = LG
INVISIBLE_ZENKAKU_SPACE_STR = IS
HIDDEN_ZENKAKU_SPACE_STR = HS
EM_ASCENT = 1802
EM_DESCENT = 246
OS2_ASCENT = 1962
Expand Down
14 changes: 6 additions & 8 deletions fontforge_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
FONTFORGE_PREFIX = settings.get("DEFAULT", "FONTFORGE_PREFIX")
IDEOGRAPHIC_SPACE = settings.get("DEFAULT", "IDEOGRAPHIC_SPACE")
WIDTH_35_STR = settings.get("DEFAULT", "WIDTH_35_STR")
INVISIBLE_ZENKAKU_SPACE_STR = settings.get("DEFAULT", "INVISIBLE_ZENKAKU_SPACE_STR")
HIDDEN_ZENKAKU_SPACE_STR = settings.get("DEFAULT", "HIDDEN_ZENKAKU_SPACE_STR")
JPDOC_STR = settings.get("DEFAULT", "JPDOC_STR")
DOT_ZERO_STR = settings.get("DEFAULT", "DOT_ZERO_STR")
NERD_FONTS_STR = settings.get("DEFAULT", "NERD_FONTS_STR")
Expand Down Expand Up @@ -98,7 +98,7 @@ def main():
def usage():
print(
f"Usage: {sys.argv[0]} "
"[--invisible-zenkaku-space] [--35] [--jpdoc] [--nerd-font] [--liga] [--dot-zero]"
"[--hidden-zenkaku-space] [--35] [--jpdoc] [--nerd-font] [--liga] [--dot-zero]"
)


Expand All @@ -115,8 +115,8 @@ def get_options():
# オプション判定
if arg == "--do-not-delete-build-dir":
options["do-not-delete-build-dir"] = True
elif arg == "--invisible-zenkaku-space":
options["invisible-zenkaku-space"] = True
elif arg == "--hidden-zenkaku-space":
options["hidden-zenkaku-space"] = True
elif arg == "--35":
options["35"] = True
elif arg == "--jpdoc":
Expand Down Expand Up @@ -180,7 +180,7 @@ def generate_font(jp_style, eng_style, merged_style):
remove_lookups(jp_font, remove_gsub=False, remove_gpos=True)

# 全角スペースを可視化する
if not options.get("invisible-zenkaku-space"):
if not options.get("hidden-zenkaku-space"):
visualize_zenkaku_space(jp_font)

# Nerd Fontのグリフを追加する
Expand All @@ -189,9 +189,7 @@ def generate_font(jp_style, eng_style, merged_style):

# オプション毎の修飾子を追加する
variant = WIDTH_35_STR if options.get("35") else ""
variant += (
INVISIBLE_ZENKAKU_SPACE_STR if options.get("invisible-zenkaku-space") else ""
)
variant += HIDDEN_ZENKAKU_SPACE_STR if options.get("hidden-zenkaku-space") else ""
variant += DOT_ZERO_STR if options.get("dot-zero") else ""
variant += JPDOC_STR if options.get("jpdoc") else ""
variant += NERD_FONTS_STR if options.get("nerd-font") else ""
Expand Down
27 changes: 17 additions & 10 deletions make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,22 @@ Remove-Item -Path .\build -Recurse -Force

# 並列処理内で、処理が重いNerd Fontsのビルドを優先して処理する
$option_and_output_folder = @(
@("--nerd-font", "NF-"), # ビルド 通常版 + Nerd Fonts
@("--35 --nerd-font", "35NF-"), # ビルド 1:2幅版 + Nerd Fonts
@("--nerd-font --liga", "NFLG-"), # ビルド 通常版 + Nerd Fonts + リガチャ
@("--35 --nerd-font --liga", "35NFLG-"), # ビルド 1:2幅版 + Nerd Fonts + リガチャ
@("", "-"), # ビルド 通常版
@("--35", "35-"), # ビルド 1:2幅版
@("--liga", "LG-"), # ビルド 通常版 + リガチャ
@("--35 --liga", "35LG-"), # ビルド 1:2幅版 + リガチャ
@("--jpdoc", "JPDOC-"), # ビルド JPDOC版
@("--35 --jpdoc", "35JPDOC-") # ビルド 1:2幅 JPDOC版
@("--nerd-font", "NF-"), # ビルド 1:2幅 + Nerd Fonts
@("--35 --nerd-font", "35NF-"), # ビルド 3:5幅 + Nerd Fonts
@("--nerd-font --liga", "NFLG-"), # ビルド 1:2幅 + Nerd Fonts + リガチャ
@("--35 --nerd-font --liga", "35NFLG-"), # ビルド 3:5幅 + Nerd Fonts + リガチャ
@("", "-"), # ビルド 1:2幅
@("--35", "35-"), # ビルド 3:5幅
@("--liga", "LG-"), # ビルド 1:2幅 + リガチャ
@("--35 --liga", "35LG-"), # ビルド 3:5幅 + リガチャ
@("--jpdoc", "JPDOC-"), # ビルド 1:2幅 JPDOC版
@("--35 --jpdoc", "35JPDOC-"), # ビルド 3:5幅 JPDOC版
@("--hidden-zenkaku-space ", "HS-"), # ビルド 1:2 全角スペース不可視
@("--hidden-zenkaku-space --35", "35HS-"), # ビルド 3:5 全角スペース不可視
@("--hidden-zenkaku-space --liga", "HSLG-"), # ビルド 1:2 全角スペース不可視 + リガチャ
@("--hidden-zenkaku-space --35 --liga", "35HSLG-"), # ビルド 3:5 全角スペース不可視 + リガチャ
@("--hidden-zenkaku-space --jpdoc", "HSJPDOC-"), # ビルド 1:2 全角スペース不可視 JPDOC版
@("--hidden-zenkaku-space --35 --jpdoc", "35HSJPDOC-") # ビルド 3:5 全角スペース不可視 JPDOC版
)

$option_and_output_folder | Foreach-Object -ThrottleLimit 4 -Parallel {
Expand All @@ -31,6 +37,7 @@ $option_and_output_folder | Foreach-Object -ThrottleLimit 4 -Parallel {
}

$move_file_src_dest = @(
@("UDEVGothic*HS*-*.ttf", "UDEVGothic_HS_$version"),
@("UDEVGothic*NF*-*.ttf", "UDEVGothic_NF_$version"),
@("UDEVGothic*-*.ttf", "UDEVGothic_$version")
)
Expand Down

0 comments on commit a583d1e

Please sign in to comment.