-
Notifications
You must be signed in to change notification settings - Fork 35
/
build-Latin.py
111 lines (94 loc) · 2.96 KB
/
build-Latin.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#! /usr/bin/env AFDKOPython
# encoding: UTF-8
from __future__ import division, absolute_import, print_function, unicode_literals
import hindkit
RELEASE = 5
COMMIT = 1
DATA = {
"roman": (
[
("100", -50),
("500", 44),
("900", 150),
],
[
("Thin", -50, 250),
("ExtraLight", -25, 275),
("Light", 0, 300),
("Regular", 21, 400),
("Medium", 44, 500),
("SemiBold", 70, 600),
("Bold", 100, 700),
("ExtraBold", 125, 800),
("Black", 150, 900),
],
),
"italic": (
[
("100i", -50),
("500i", 44),
("900i", 150),
],
[
("Thin Italic", -50, 250),
("ExtraLight Italic", -25, 275),
("Light Italic", 0, 300),
("Italic", 21, 400),
("Medium Italic", 44, 500),
("SemiBold Italic", 70, 600),
("Bold Italic", 100, 700),
("ExtraBold Italic", 125, 800),
("Black Italic", 150, 900),
],
),
}
def main():
for master_scheme, style_scheme in DATA.values():
family = hindkit.Family(
trademark = "Poppins",
script_name = "Latin",
append_script_name = True,
initial_release_year = 2014,
source_tag = "Latin",
)
family.set_masters(master_scheme)
for i in family.masters:
i._filename = "Poppins-{}".format(i.name)
family.set_styles(style_scheme)
i = family.info
i.openTypeNameDesigner = "Jonny Pinhorn"
i.openTypeHheaAscender, i.openTypeHheaDescender, i.openTypeHheaLineGap = 1050, -350, 100
i.openTypeOS2WinAscent, i.openTypeOS2WinDescent = 1135, 627
project = hindkit.Project(
family,
release_commit = (RELEASE, COMMIT),
options = {
"do_style_linking": True,
"additional_unicode_range_bits": [1, 2],
"use_os_2_version_4": True,
"prefer_typo_metrics": True,
"build_ttf": True,
},
)
project.build()
# --- Overriding ---
hindkit.Project.directories["GOADB"] = "GlyphOrderAndAliasDB-Latin"
hindkit.constants.DERIVABLE_GLYPHS.update(
{"quoteright.ss01": ["apostrophemod.ss01"]}
)
def master_postprocess(self):
target_font = self.open()
for glyph in target_font:
glyph.clearAnchors()
self.import_from_font(
source_path = "resources/ITF Misc-Regular.ufo",
glyph_names_included = [".notdef"],
)
self.derive_glyphs([
"NULL", "CR", "nonbreakingspace",
"softhyphen", "divisionslash", "bulletoperator", "macronmod", "apostrophemod",
"apostrophemod.ss01",
])
hindkit.Master.postprocess = master_postprocess
# --- Executing ---
main()