-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFonts.py
More file actions
42 lines (32 loc) · 728 Bytes
/
Fonts.py
File metadata and controls
42 lines (32 loc) · 728 Bytes
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
attributes = {
'Skylark': {
'color': 'r',
'code': 0
},
'Sweet Puppy': {
'color': 'b',
'code': 1
},
'Ubuntu Mono': {
'color': 'g',
'code': 2
}
}
def encode_name(font_name: str):
return attributes[font_name]['code']
def decode_name(font_code: int):
for k in attributes:
if attributes[k]['code'] == font_code:
return k
def get_list():
return list(attributes.keys())
def get_number():
return len(attributes)
def bb_color(font):
tmp = font.decode('UTF-8')
res = 'b'
for font_name, data in attributes.items():
if tmp == font_name:
res = data['color']
break
return res