/
fonts.dei
169 lines (146 loc) · 3.99 KB
/
fonts.dei
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Fonts for the default UI style
#
# - family: font family name
# - size can be "pt" or "px", defaults to "pt"
# - weight: normal, bold, light
# - style: normal, italic
# - transform: normal, uppercase, lowercase
script {
import Version, gui, DisplayMode
# Load the Open Sans font contained in this pack.
def loadOpenSans()
import App
fontDir = __file__.fileNamePath() / "fonts"
# Sadly, light fonts seem to not work in Qt presently.
for style in ['Regular', 'Bold', 'Italic', 'BoldItalic'] #'Light', 'LightItalic'
App.loadFont(fontDir / ("OpenSans-%s.ttf" % style))
end
end
}
group {
condition: Version.OS == 'windows'
script { loadOpenSans() }
font default {
family: Open Sans
size: 12pt
weight: normal
style: normal
}
font monospace inherits default {
family: Courier New
size: 10pt
}
}
group {
condition: Version.OS == 'macx'
script {
# Define mappings for native font styles and weights.
import App
App.addFontMapping("SF UI Text", {
['regular', 25]: 'SFUIText-Light',
['regular', 50]: 'SFUIText-Regular',
['regular', 75]: 'SFUIText-Bold',
['italic', 25]: 'SFUIText-LightItalic',
['italic', 50]: 'SFUIText-Italic',
['italic', 75]: 'SFUIText-BoldItalic'
})
App.addFontMapping("SF UI Display", {
['regular', 25]: 'SFUIDisplay-Light',
['regular', 50]: 'SFUIDisplay-Regular',
['regular', 75]: 'SFUIDisplay-Bold',
['italic', 25]: 'SFUIText-LightItalic', # Only non-italic available.
['italic', 50]: 'SFUIText-Italic',
['italic', 75]: 'SFUIText-BoldItalic'
})
App.addFontMapping("Menlo", {
['regular', 25]: 'Menlo-Regular',
['regular', 50]: 'Menlo-Regular',
['regular', 75]: 'Menlo-Bold',
['italic', 25]: 'Menlo-Italic',
['italic', 50]: 'Menlo-Italic',
['italic', 75]: 'Menlo-BoldItalic'
})
}
font default {
family: SF UI Text
size $: gui.scale('16pt', DisplayMode.DPI_FACTOR)
weight: normal
style: normal
}
font monospace inherits default {
family: Menlo
size $: gui.scale('13pt', DisplayMode.DPI_FACTOR)
}
}
group {
condition: Version.OS == 'unix'
font default {
family: Liberation Sans
size $: gui.scale("13pt", DisplayMode.DPI_FACTOR)
weight: normal
style: normal
}
font monospace inherits default {
family: FreeMono
size $: gui.scale("12pt", DisplayMode.DPI_FACTOR)
}
}
font title inherits default {
size $: gui.scale(self.size, 1.75)
weight: light
}
font heading inherits title {
size $: gui.scale(default.size, 1.2)
}
script {
if Version.OS == 'macx'
# Use the larger variant.
title.family = "SF UI Display"
heading.family = "SF UI Display"
end
}
font small inherits default {
size $: gui.scale(self.size, 0.75)
}
editor {
font plaintext inherits default {}
font hint inherits default {
style: italic
weight: light
}
}
separator {
font empty inherits default {
size $: gui.scale(self.size, 0.5)
}
font label inherits default {
condition: Version.OS == 'macx'
size $: gui.scale(self.size, 0.7)
transform: uppercase
}
font label inherits small {
condition: Version.OS != 'macx'
weight: bold
}
font annotation inherits small {}
}
choice {
font selected inherits default {
weight: bold
}
}
tab {
font label inherits title {
size $: gui.scale(self.size, 0.75)
}
font selected inherits tab.label {}
}
slider {
font label inherits small {}
font value inherits slider.label {
weight: bold
}
}
log {
font normal inherits default {}
}