Skip to content

Commit

Permalink
Add full-width space width adjustment process
Browse files Browse the repository at this point in the history
  • Loading branch information
yuru7 committed Jun 11, 2024
1 parent 98dc0a0 commit 09390ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[DEFAULT]
VERSION = v2.0.0-beta5
VERSION = v2.0.0-beta6
FONT_NAME = PlemolJP
JP_FONT = IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-{style}.ttf
ENG_FONT = IBM-Plex-Mono/IBMPlexMono-{style}.ttf
Expand Down
11 changes: 9 additions & 2 deletions fontforge_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,10 +667,17 @@ def transform_half_width(jp_font, eng_font):
def visualize_zenkaku_space(jp_font):
"""全角スペースを可視化する"""
# 全角スペースを差し替え
glyph = jp_font[0x3000]
width_to = glyph.width
glyph.clear()
jp_font.mergeFonts(fontforge.open(f"{SOURCE_FONTS_DIR}/{IDEOGRAPHIC_SPACE}"))
# 幅を設定し位置調整
jp_font.selection.select("U+3000")
for glyph in jp_font.selection.byGlyphs:
glyph.clear()
jp_font.mergeFonts(fontforge.open(f"{SOURCE_FONTS_DIR}/{IDEOGRAPHIC_SPACE}"))
width_from = glyph.width
glyph.transform(psMat.translate((width_to - width_from) / 2, 0))
glyph.width = width_to
jp_font.selection.none()


def merge_hack(eng_font, style):
Expand Down

0 comments on commit 09390ed

Please sign in to comment.