-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmake_bold.py
More file actions
34 lines (25 loc) · 900 Bytes
/
make_bold.py
File metadata and controls
34 lines (25 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import configparser
import fontforge
settings = configparser.ConfigParser()
settings.read("build.ini", encoding="utf-8")
SOURCE_FONTS_DIR = settings.get("DEFAULT", "SOURCE_FONTS_DIR")
def main():
font = fontforge.open(f"{SOURCE_FONTS_DIR}/0xProto/0xProto-Italic.ttf")
print("***** BoldItalic用の太字フォントを作成します *****")
for i, glyph in enumerate(font.glyphs()):
if i % 100 == 0:
print(f"{i}文字目を処理中")
if glyph.isWorthOutputting():
glyph.stroke(
"circular",
36,
"nib",
"miter",
removeinternal=True,
removeoverlap="none",
)
glyph.removeOverlap()
# ttfファイルを保存
font.generate(f"{SOURCE_FONTS_DIR}/custom-0xProto-BoldItalic.ttf")
if __name__ == "__main__":
main()