Skip to content

Commit

Permalink
add dot-zero option
Browse files Browse the repository at this point in the history
  • Loading branch information
yuru7 committed Jun 9, 2024
1 parent 9d3b727 commit f2b9e83
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion build.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[DEFAULT]
VERSION = v2.0.0
VERSION = v2.0.0-beta1
FONT_NAME = UDEV Gothic
JP_FONT = fontforge_export_BIZUDGothic-{style}.ttf
ENG_FONT = JetBrainsMonoNL-{style}.ttf
Expand All @@ -12,6 +12,7 @@ FONTTOOLS_PREFIX = fonttools_
IDEOGRAPHIC_SPACE = ideographic_space.sfd
WIDTH_35_STR = 35
JPDOC_STR = JPDOC
DOT_ZERO_STR = DZ
NERD_FONTS_STR = NF
LIGA_STR = LG
INVISIBLE_ZENKAKU_SPACE_STR = IS
Expand Down
7 changes: 6 additions & 1 deletion fontforge_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
WIDTH_35_STR = settings.get("DEFAULT", "WIDTH_35_STR")
INVISIBLE_ZENKAKU_SPACE_STR = settings.get("DEFAULT", "INVISIBLE_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")
LIGA_STR = settings.get("DEFAULT", "LIGA_STR")
EM_ASCENT = int(settings.get("DEFAULT", "EM_ASCENT"))
Expand Down Expand Up @@ -124,6 +125,8 @@ def get_options():
options["nerd-font"] = True
elif arg == "--liga":
options["liga"] = True
elif arg == "--dot-zero":
options["dot-zero"] = True
else:
options["unknown-option"] = True
return
Expand All @@ -136,7 +139,8 @@ def generate_font(jp_style, eng_style, merged_style):
jp_font, eng_font = open_fonts(jp_style, eng_style)

# 0 をスラッシュゼロにする
slash_zero(eng_font, eng_style)
if not options.get("dot-zero"):
slash_zero(eng_font, eng_style)

# フォントのEMを揃える
adjust_em(eng_font)
Expand Down Expand Up @@ -188,6 +192,7 @@ def generate_font(jp_style, eng_style, merged_style):
variant += (
INVISIBLE_ZENKAKU_SPACE_STR if options.get("invisible-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 ""
variant += LIGA_STR if options.get("liga") else ""
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fonttools==4.40.0
ttfautohint-py==0.5.1

0 comments on commit f2b9e83

Please sign in to comment.