-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInfoScreen.kv
More file actions
252 lines (223 loc) · 8.96 KB
/
Copy pathInfoScreen.kv
File metadata and controls
252 lines (223 loc) · 8.96 KB
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
#: import _ localization._
#: import date datetime.date
<InfoScreen>
current_info_lang_code: "en"
# get id inside out to root for object reference
info_lang: info_lang
add_info_lang_btn: add_info_lang_btn
font_name: font_name
font_style: font_style
font_full_name: font_full_name
version_num_maj: version_num_maj
version_num_min: version_num_min
version_text: version_text
copyright: copyright
license: license
license_url: license_url
trademark: trademark
designer_name: designer_name
designer_url: designer_url
vendor_code: vendor_code
vendor_url: vendor_url
manufacturer_name: manufacturer_name
description: description
sample_text: sample_text
MDScrollView:
MDGridLayout:
cols: 1
padding: "24dp", "8dp"
size_hint_y: None
height: self.minimum_height
MDRelativeLayout:
size: self.size[0], info_lang.height
pos: self.pos
size_hint_y: None
MDTextField:
id: info_lang
pos_hint: {"center_y": .5}
write_tab: False
hint_text: _("Current font information language")
text: "English, United States"
readonly: True
on_focus:
if self.focus and root.info_lang_menu is not None: root.info_lang_menu.open()
MDIconButton:
id: add_info_lang_btn
icon: "minus"
pos_hint: {"center_y": .5}
size_hint: None, None
size: 16, 16
pos: info_lang.width - self.width * 2 + dp(8), 0
theme_text_color: "Hint"
on_release: root.show_delete_language_dialog()
MDIconButton:
id: add_info_lang_btn
icon: "plus"
pos_hint: {"center_y": .5}
size_hint: None, None
size: 16, 16
pos: info_lang.width - self.width + dp(8), 0
theme_text_color: "Hint"
on_release: root.show_add_info_lang_dialog()
# label hide when not english
MDLabel:
font_style: "Subtitle2"
text: _("Only ASCII characters are accepted for English names.") if root.current_info_lang_code == "en" else ""
size_hint_y: None
height: (self.texture_size[1] * 1.5) if root.current_info_lang_code == "en" else 0
SetupRow:
MDTextField:
id: font_name
pos_hint: {'center_y': .5}
size_hint_x: 2
hint_text: _("Font family name")
required: True
# allow tabbing to next input field
write_tab: False
text: "My Font"
helper_text: _("Only ASCII characters are accepted for English names.")
helper_text_mode: "on_error"
on_text: root.verify_ascii_name()
MDTextField:
id: font_style
pos_hint: {'center_y': .5}
hint_text: _("Font style name")
required: True
write_tab: False
text: "Regular"
on_focus:
if root.font_style_menu is None: root.init_style_menu()
if self.focus: root.font_style_menu.open()
SetupRow:
MDTextField:
id: font_full_name
readonly: True
pos_hint: {'center_y': .5}
size_hint_x: 2
text: font_name.text + "-" + font_style.text
hint_text: _("Full font name")
# only require if english
required: True
write_tab: False
SetupRow:
spacing: "6dp"
MDTextField:
id: version_num_maj
pos_hint: {'center_y': .5}
hint_text: _("Major")
helper_text: _("Max 999")
helper_text_mode: "on_focus"
max_text_length: 3
input_filter: "int"
write_tab: False
text: "1"
MDLabel:
text: "."
size_hint_x: None
width: self.texture_size[0]
MDTextField:
id: version_num_min
pos_hint: {'center_y': .5}
hint_text: _("Minor")
helper_text: _("Max 999")
helper_text_mode: "on_focus"
max_text_length: 3
input_filter: "int"
write_tab: False
text: "000"
MDTextField:
id: version_text
pos_hint: {'center_y': .5}
size_hint_x: 6
hint_text: _("Font version text")
# only require if english
required: True if root.current_info_lang_code == "en" else False
write_tab: False
text: "Version {}.{}; {}; SVG2FontBuilder".format(version_num_maj.text[:3], version_num_min.text[:3].zfill(3), date.today().strftime("%Y%m%d"))
MDRaisedButton:
text: _("Save info")
md_bg_color: app.theme_cls.accent_color
on_press: root.make_name()
MDLabel:
font_style: "Subtitle2"
text: _("You may safely ignore the additional fields below.")
size_hint_y: None
height: self.texture_size[1] * 2
SetupRow:
MDTextField:
id: copyright
pos_hint: {'center_y': .5}
multiline: True
max_height: "200dp"
hint_text: _("Copyright notice")
write_tab: False
SetupRow:
MDTextField:
id: license
pos_hint: {'center_y': .5}
multiline: True
max_height: "200dp"
hint_text: _("License notice")
write_tab: False
SetupRow:
MDTextField:
id: license_url
pos_hint: {'center_y': .5}
hint_text: _("License URL")
icon_left: "web"
write_tab: False
SetupRow:
MDTextField:
id: trademark
pos_hint: {'center_y': .5}
multiline: True
max_height: "100dp"
hint_text: _("Trademark")
write_tab: False
SetupRow:
MDTextField:
id: designer_name
pos_hint: {'center_y': .5}
hint_text: _("Designer name")
write_tab: False
MDTextField:
id: designer_url
pos_hint: {'center_y': .5}
hint_text: _("Designer URL")
icon_left: "web"
write_tab: False
SetupRow:
MDTextField:
id: vendor_code
pos_hint: {'center_y': .5}
hint_text: _("Vendor code")
max_text_length: 4
write_tab: False
MDTextField:
id: vendor_url
pos_hint: {'center_y': .5}
size_hint_x: 3
hint_text: _("Vendor URL")
icon_left: "web"
write_tab: False
MDTextField:
id: manufacturer_name
pos_hint: {'center_y': .5}
size_hint_x: 3
hint_text: _("Manufacturer name")
write_tab: False
SetupRow:
MDTextField:
id: description
pos_hint: {'center_y': .5}
multiline: True
max_height: "200dp"
hint_text: _("Description")
helper_text: _("Can contain revision information, usage recommendations, history, features, etc.")
write_tab: False
SetupRow:
MDTextField:
id: sample_text
pos_hint: {'center_y': .5}
hint_text: _("Sample text")
write_tab: False