-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathnumber_font.py
More file actions
114 lines (102 loc) · 2.67 KB
/
number_font.py
File metadata and controls
114 lines (102 loc) · 2.67 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
from source.custard import *
def pc_style_input_key(char: str) -> CustomKey:
return CustomKey(
design=KeyDesign(
label=TextLabel(text=char),
color=KeyColor.normal
),
press_actions=[
InputAction(char)
],
longpress_actions=LongpressAction(),
variations=[]
)
keys: list[KeyData] = []
numbers = [
list("1234567890"),
list("①②③④⑤⑥⑦⑧⑨⓪"),
list("𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡𝟘"),
list("𝟏𝟐𝟑𝟒𝟓𝟔𝟕𝟖𝟗𝟎")
]
for i in range(len(numbers)):
for j in range(len(numbers[i])):
x, y = (j, i)
keyData = KeyData(
specifier=GridFitSpecifier(x=x, y=y),
key=pc_style_input_key(numbers[i][j])
)
keys.append(keyData)
keys.append(KeyData(
specifier=GridFitSpecifier(x=0, y=4),
key=CustomKey(
design=KeyDesign(
label=SystemImageLabel("list.bullet"),
color=KeyColor.special
),
press_actions=[
ToggleTabBarAction()
],
longpress_actions=LongpressAction(),
variations=[]
)
))
keys.append(KeyData(
specifier=GridFitSpecifier(x=1, y=4),
key=SystemKey(SystemKeyType.change_keyboard)
))
keys.append(KeyData(
specifier=GridFitSpecifier(x=2, y=4),
key=CustomKey(
design=KeyDesign(
label=SystemImageLabel("delete.left"),
color=KeyColor.special
),
press_actions=[
DeleteAction(1)
],
longpress_actions=LongpressAction(
repeat=[
DeleteAction(1)
]
),
variations=[]
)
))
keys.append(KeyData(
specifier=GridFitSpecifier(x=3, y=4, width=4, height=1),
key=CustomKey(
design=KeyDesign(
label=TextLabel("空白"),
color=KeyColor.normal
),
press_actions=[
InputAction(" ")
],
longpress_actions=LongpressAction(
start=[
ToggleTabBarAction()
]
),
variations=[]
)
))
keys.append(KeyData(
specifier=GridFitSpecifier(x=7, y=4, width=3, height=1),
key=SystemKey(SystemKeyType.enter)
))
#カスタードオブジェクトを作成
hieroglyphs_custard = Custard(
identifier="number_font",
language=Language.none,
input_style=InputStyle.direct,
metadata=Metadata(
custard_version="1.0",
display_name="装飾数字",
),
interface=Interface(
key_style=KeyStyle.pc_style,
key_layout=GridFitLayout(row_count=10, column_count=5),
keys=keys
)
)
hieroglyphs_custard.write(name="number_font")