-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
64 lines (56 loc) · 1.89 KB
/
main.py
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import logging
import os
import shutil
import font_service
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('main')
def main():
project_root_dir = os.path.abspath(os.path.dirname(__file__))
fonts_dir = os.path.join(project_root_dir, 'assets', 'fonts')
build_dir = os.path.join(project_root_dir, 'build')
if os.path.exists(build_dir):
shutil.rmtree(build_dir)
font_service.create_font_sheet(
font_size=8,
outputs_name='quan',
outputs_dir=build_dir,
font_file_path=os.path.join(fonts_dir, 'quan', 'quan.ttf'),
)
font_service.create_font_sheet(
font_size=12,
outputs_name='fusion-pixel-monospaced',
outputs_dir=build_dir,
font_file_path=os.path.join(fonts_dir, 'fusion-pixel-monospaced', 'fusion-pixel-monospaced.otf'),
binarize=True,
)
font_service.create_font_sheet(
font_size=12,
outputs_name='fusion-pixel-proportional',
outputs_dir=build_dir,
font_file_path=os.path.join(fonts_dir, 'fusion-pixel-proportional', 'fusion-pixel-proportional.otf'),
binarize=True,
)
font_service.create_font_sheet(
font_size=16,
outputs_name='unifont',
outputs_dir=build_dir,
font_file_path=os.path.join(fonts_dir, 'unifont', 'unifont-15.0.01.ttf'),
)
font_service.create_font_sheet(
font_size=24,
outputs_name='roboto',
outputs_dir=build_dir,
font_file_path=os.path.join(fonts_dir, 'roboto', 'Roboto-Regular.ttf'),
pretty_json=True,
binarize=True,
)
font_service.create_font_sheet(
font_size=30,
outputs_name='source-sans',
outputs_dir=build_dir,
font_file_path=os.path.join(fonts_dir, 'source-sans', 'SourceHanSans-Regular-SC.otf'),
sheet_max_width=4096,
pretty_json=True,
)
if __name__ == '__main__':
main()