-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSVG2FontBuilder.kv
More file actions
164 lines (133 loc) · 4.62 KB
/
Copy pathSVG2FontBuilder.kv
File metadata and controls
164 lines (133 loc) · 4.62 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
#: import MDFadeSlideTransition kivymd.uix.transition.transition.MDFadeSlideTransition
#: import _ localization._
MDFloatLayout:
screen_manager: screen_manager.__init__
MDNavigationLayout:
MDNavigationDrawer:
id: nav_drawer
type: "standard"
radius: (0, 16, 16, 0)
pos_hint: {"top": 1}
ContentNavigationDrawer:
screen_manager: screen_manager
nav_drawer: nav_drawer
MDScreenManager:
MDScreen:
MDBoxLayout:
orientation: "vertical"
MDTopAppBar:
pos_hint: {"top": 1}
elevation: 4
title: _("SVG2FontBuilder")
left_action_items: [["menu", lambda x: nav_drawer.set_state("toggle")]]
MDScreenManager:
id: screen_manager
transition: MDFadeSlideTransition()
SetupScreen:
name: "setupscr1"
InfoScreen:
name: "infoscr2"
MetricScreen:
name: "metricscr3"
AboutScreen:
name: "aboutscr"
# Drawer content
<ContentNavigationDrawer@MDScrollView>
MDNavigationDrawerMenu:
MDNavigationDrawerHeader:
title: _("SVG2FontBuilder")
title_color: app.theme_cls.text_color
text: _("SVG to OpenType font generator")
spacing: "4dp"
padding: "12dp", 0, 0, "36dp"
DrawerClickableItem:
text: _("Setup")
icon: "format-font"
on_release:
root.screen_manager.current = "setupscr1"
DrawerClickableItem:
text: _("Font Info")
icon: "book-information-variant"
on_release:
root.screen_manager.current = "infoscr2"
DrawerClickableItem:
text: _("Font Metrics")
icon: "format-letter-spacing-variant"
on_release:
root.screen_manager.current = "metricscr3"
MDNavigationDrawerDivider:
MDNavigationDrawerLabel:
text: _("Software")
DrawerClickableItem:
text: _("Settings")
icon: "cog"
on_release:
app.open_settings()
DrawerClickableItem:
text: _("About")
icon: "information"
on_release:
root.screen_manager.current = "aboutscr"
# Drawer content label class
<DrawerClickableItem@MDNavigationDrawerItem>
focus_color: app.theme_cls.primary_color
text_color: app.theme_cls.secondary_text_color
icon_color: app.theme_cls.secondary_text_color
ripple_color: app.theme_cls.bg_dark
selected_color: app.theme_cls.accent_color
# warning snackbar
<MDWarningSnackbar>
MDBoxLayout:
orientation: "horizontal"
padding: "8dp"
spacing: "16dp"
MDIcon:
size_hint: None, None
pos_hint: {'center_y': .5}
icon: root.icon
MDLabel:
id: text_bar
size_hint_y: None
height: self.texture_size[1]
text: root.text
font_size: root.font_size
theme_text_color: 'Custom'
text_color: app.theme_cls.text_color
shorten: True
shorten_from: 'right'
pos_hint: {'center_y': .5}
# loading spinner
<LoadingScreen>
size_hint_y: None
height: dp(46)
pos_hint: {'center_y': .95}
spacing: "32dp"
MDSpinner:
size_hint: None, None
size: dp(46), dp(46)
pos_hint: {'center_y': 0.5}
active: True
MDLabel:
text: _("Processing...")
pos_hint: {'center_y': 0.5}
<AboutScreen>
MDFloatLayout:
MDLabel:
text: _("Made by @NightFurySL2001\nLicensed under MIT License")
halign: "center"
size_hint_y: None
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
MDLabel:
text: root.app_version_tag
halign: "right"
size_hint_y: None
height: self.texture_size[1] * 2
pos_hint: {'right': 1, "bottom":1}
# sample code to copy for showing box size
<ColourBoundingBox@BaseLayout>
canvas.before:
Color:
rgba: 1., 0., 0., .3
Rectangle:
pos: self.pos
size: self.size