-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathu8util.py
455 lines (429 loc) · 22.4 KB
/
u8util.py
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# coding=utf-8
texture_font_char_us_0= "textures/segment2/font_graphics.05900.ia4"
texture_font_char_us_1= "textures/segment2/font_graphics.05940.ia4"
texture_font_char_us_2= "textures/segment2/font_graphics.05980.ia4"
texture_font_char_us_3= "textures/segment2/font_graphics.059C0.ia4"
texture_font_char_us_4= "textures/segment2/font_graphics.05A00.ia4"
texture_font_char_us_5= "textures/segment2/font_graphics.05A40.ia4"
texture_font_char_us_6= "textures/segment2/font_graphics.05A80.ia4"
texture_font_char_us_7= "textures/segment2/font_graphics.05AC0.ia4"
texture_font_char_us_8= "textures/segment2/font_graphics.05B00.ia4"
texture_font_char_us_9= "textures/segment2/font_graphics.05B40.ia4"
texture_font_char_us_A= "textures/segment2/font_graphics.05B80.ia4"
texture_font_char_us_B= "textures/segment2/font_graphics.05BC0.ia4"
texture_font_char_us_C= "textures/segment2/font_graphics.05C00.ia4"
texture_font_char_us_D= "textures/segment2/font_graphics.05C40.ia4"
texture_font_char_us_E= "textures/segment2/font_graphics.05C80.ia4"
texture_font_char_us_F= "textures/segment2/font_graphics.05CC0.ia4"
texture_font_char_us_G= "textures/segment2/font_graphics.05D00.ia4"
texture_font_char_us_H= "textures/segment2/font_graphics.05D40.ia4"
texture_font_char_us_I= "textures/segment2/font_graphics.05D80.ia4"
texture_font_char_us_J= "textures/segment2/font_graphics.05DC0.ia4"
texture_font_char_us_K= "textures/segment2/font_graphics.05E00.ia4"
texture_font_char_us_L= "textures/segment2/font_graphics.05E40.ia4"
texture_font_char_us_M= "textures/segment2/font_graphics.05E80.ia4"
texture_font_char_us_N= "textures/segment2/font_graphics.05EC0.ia4"
texture_font_char_us_O= "textures/segment2/font_graphics.05F00.ia4"
texture_font_char_us_P= "textures/segment2/font_graphics.05F40.ia4"
texture_font_char_us_Q= "textures/segment2/font_graphics.05F80.ia4"
texture_font_char_us_R= "textures/segment2/font_graphics.05FC0.ia4"
texture_font_char_us_S= "textures/segment2/font_graphics.06000.ia4"
texture_font_char_us_T= "textures/segment2/font_graphics.06040.ia4"
texture_font_char_us_U= "textures/segment2/font_graphics.06080.ia4"
texture_font_char_us_V= "textures/segment2/font_graphics.060C0.ia4"
texture_font_char_us_W= "textures/segment2/font_graphics.06100.ia4"
texture_font_char_us_X= "textures/segment2/font_graphics.06140.ia4"
texture_font_char_us_Y= "textures/segment2/font_graphics.06180.ia4"
texture_font_char_us_Z= "textures/segment2/font_graphics.061C0.ia4"
texture_font_char_us_a= "textures/segment2/font_graphics.06200.ia4"
texture_font_char_us_b= "textures/segment2/font_graphics.06240.ia4"
texture_font_char_us_c= "textures/segment2/font_graphics.06280.ia4"
texture_font_char_us_d= "textures/segment2/font_graphics.062C0.ia4"
texture_font_char_us_e= "textures/segment2/font_graphics.06300.ia4"
texture_font_char_us_f= "textures/segment2/font_graphics.06340.ia4"
texture_font_char_us_g= "textures/segment2/font_graphics.06380.ia4"
texture_font_char_us_h= "textures/segment2/font_graphics.063C0.ia4"
texture_font_char_us_i= "textures/segment2/font_graphics.06400.ia4"
texture_font_char_us_j= "textures/segment2/font_graphics.06440.ia4"
texture_font_char_us_k= "textures/segment2/font_graphics.06480.ia4"
texture_font_char_us_l= "textures/segment2/font_graphics.064C0.ia4"
texture_font_char_us_m= "textures/segment2/font_graphics.06500.ia4"
texture_font_char_us_n= "textures/segment2/font_graphics.06540.ia4"
texture_font_char_us_o= "textures/segment2/font_graphics.06580.ia4"
texture_font_char_us_p= "textures/segment2/font_graphics.065C0.ia4"
texture_font_char_us_q= "textures/segment2/font_graphics.06600.ia4"
texture_font_char_us_r= "textures/segment2/font_graphics.06640.ia4"
texture_font_char_us_s= "textures/segment2/font_graphics.06680.ia4"
texture_font_char_us_t= "textures/segment2/font_graphics.066C0.ia4"
texture_font_char_us_u= "textures/segment2/font_graphics.06700.ia4"
texture_font_char_us_v= "textures/segment2/font_graphics.06740.ia4"
texture_font_char_us_w= "textures/segment2/font_graphics.06780.ia4"
texture_font_char_us_x= "textures/segment2/font_graphics.067C0.ia4"
texture_font_char_us_y= "textures/segment2/font_graphics.06800.ia4"
texture_font_char_us_z= "textures/segment2/font_graphics.06840.ia4"
texture_font_char_us_left_right_arrow= "textures/segment2/font_graphics.06880.ia4"
texture_font_char_us_exclamation= "textures/segment2/font_graphics.068C0.ia4"
texture_font_char_us_coin= "textures/segment2/font_graphics.06900.ia4"
texture_font_char_us_multiply= "textures/segment2/font_graphics.06940.ia4"
texture_font_char_us_open_parentheses= "textures/segment2/font_graphics.06980.ia4"
texture_font_char_us_close_open_parentheses= "textures/segment2/font_graphics.069C0.ia4"
texture_font_char_us_close_parentheses= "textures/segment2/font_graphics.06A00.ia4"
texture_font_char_us_tilde= "textures/segment2/font_graphics.06A40.ia4"
texture_font_char_us_period= "textures/segment2/font_graphics.06A80.ia4"
texture_font_char_us_percent= "textures/segment2/font_graphics.06AC0.ia4"
texture_font_char_us_interpunct= "textures/segment2/font_graphics.06B00.ia4"
texture_font_char_us_comma= "textures/segment2/font_graphics.06B40.ia4"
texture_font_char_us_apostrophe= "textures/segment2/font_graphics.06B80.ia4"
texture_font_char_us_question= "textures/segment2/font_graphics.06BC0.ia4"
texture_font_char_us_star_filled= "textures/segment2/font_graphics.06C00.ia4"
texture_font_char_us_star_hollow= "textures/segment2/font_graphics.06C40.ia4"
texture_font_char_us_double_quote_open= "textures/segment2/font_graphics.06C80.ia4"
texture_font_char_us_double_quote_close= "textures/segment2/font_graphics.06CC0.ia4"
texture_font_char_us_ellipsis= "textures/segment2/font_graphics.06D00.ia4"
texture_font_char_us_slash= "textures/segment2/font_graphics.06D40.ia4"
texture_font_char_us_ampersand= "textures/segment2/font_graphics.06D80.ia4"
texture_font_char_us_button_A= "textures/segment2/font_graphics.06DC0.ia4"
texture_font_char_us_button_B= "textures/segment2/font_graphics.06E00.ia4"
texture_font_char_us_button_C= "textures/segment2/font_graphics.06E40.ia4"
texture_font_char_us_button_Z= "textures/segment2/font_graphics.06E80.ia4"
texture_font_char_us_button_R= "textures/segment2/font_graphics.06EC0.ia4"
texture_font_char_us_button_C_up= "textures/segment2/font_graphics.06F00.ia4"
texture_font_char_us_button_C_down= "textures/segment2/font_graphics.06F40.ia4"
texture_font_char_us_button_C_left= "textures/segment2/font_graphics.06F80.ia4"
texture_font_char_us_button_C_right= "textures/segment2/font_graphics.06FC0.ia4"
texture_font_char_mayus_accent_a = "textures/special/mayus_accent_a"
texture_font_char_mayus_accent_e = "textures/special/mayus_accent_e"
texture_font_char_mayus_accent_i = "textures/special/mayus_accent_i"
texture_font_char_mayus_accent_o = "textures/special/mayus_accent_o"
texture_font_char_mayus_accent_u = "textures/special/mayus_accent_u"
texture_font_char_mayus_umlaut = "textures/special/mayus_umlaut"
texture_font_char_exclamation = "textures/special/exclamation"
texture_font_char_mayus_enye = "textures/special/mayus_enye"
texture_font_char_accent_a = "textures/special/accent_a"
texture_font_char_accent_e = "textures/special/accent_e"
texture_font_char_accent_i = "textures/special/accent_i"
texture_font_char_accent_o = "textures/special/accent_o"
texture_font_char_accent_u = "textures/special/accent_u"
texture_font_char_question = "textures/special/question"
texture_font_char_umlaut = "textures/special/umlaut"
texture_font_char_enye = "textures/special/enye"
main_font_lut = [
texture_font_char_us_0, texture_font_char_us_1, texture_font_char_us_2, texture_font_char_us_3,
texture_font_char_us_4, texture_font_char_us_5, texture_font_char_us_6, texture_font_char_us_7,
texture_font_char_us_8, texture_font_char_us_9, texture_font_char_us_A, texture_font_char_us_B,
texture_font_char_us_C, texture_font_char_us_D, texture_font_char_us_E, texture_font_char_us_F,
texture_font_char_us_G, texture_font_char_us_H, texture_font_char_us_I, texture_font_char_us_J,
texture_font_char_us_K, texture_font_char_us_L, texture_font_char_us_M, texture_font_char_us_N,
texture_font_char_us_O, texture_font_char_us_P, texture_font_char_us_Q, texture_font_char_us_R,
texture_font_char_us_S, texture_font_char_us_T, texture_font_char_us_U, texture_font_char_us_V,
texture_font_char_us_W, texture_font_char_us_X, texture_font_char_us_Y, texture_font_char_us_Z,
texture_font_char_us_a, texture_font_char_us_b, texture_font_char_us_c, texture_font_char_us_d,
texture_font_char_us_e, texture_font_char_us_f, texture_font_char_us_g, texture_font_char_us_h,
texture_font_char_us_i, texture_font_char_us_j, texture_font_char_us_k, texture_font_char_us_l,
texture_font_char_us_m, texture_font_char_us_n, texture_font_char_us_o, texture_font_char_us_p,
texture_font_char_us_q, texture_font_char_us_r, texture_font_char_us_s, texture_font_char_us_t,
texture_font_char_us_u, texture_font_char_us_v, texture_font_char_us_w, texture_font_char_us_x,
texture_font_char_us_y, texture_font_char_us_z, texture_font_char_us_apostrophe, texture_font_char_us_period,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
texture_font_char_us_button_C_up, texture_font_char_us_button_C_down, texture_font_char_us_button_C_left, texture_font_char_us_button_C_right,
texture_font_char_us_button_A, texture_font_char_us_button_B, texture_font_char_us_button_C, texture_font_char_us_button_Z,
texture_font_char_us_button_R, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, texture_font_char_us_comma,
# SPECIAL CHARS: Start ID - 112:0x70
texture_font_char_accent_a, texture_font_char_accent_e, texture_font_char_accent_i, texture_font_char_accent_o,
texture_font_char_accent_u, texture_font_char_mayus_accent_a, texture_font_char_mayus_accent_e, texture_font_char_mayus_accent_i,
texture_font_char_mayus_accent_o, texture_font_char_mayus_accent_u, texture_font_char_enye, texture_font_char_mayus_enye,
texture_font_char_umlaut, texture_font_char_mayus_umlaut, texture_font_char_question, texture_font_char_exclamation,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, texture_font_char_us_slash,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, texture_font_char_us_open_parentheses, texture_font_char_us_close_open_parentheses, texture_font_char_us_close_parentheses,
texture_font_char_us_left_right_arrow, texture_font_char_us_ampersand, texture_font_char_us_ellipsis, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, texture_font_char_us_exclamation, texture_font_char_us_percent,
texture_font_char_us_question, texture_font_char_us_double_quote_open, texture_font_char_us_double_quote_close, texture_font_char_us_tilde,
0x0, texture_font_char_us_coin, texture_font_char_us_star_filled, texture_font_char_us_multiply,
texture_font_char_us_interpunct, texture_font_char_us_star_hollow, 0x0, 0x0,
]
charmap = {
"0": [0x00, None], "0": [0x00, None], "1": [0x01, None], "1": [0x01, None],
"2": [0x02, None], "2": [0x02, None], "3": [0x03, None], "3": [0x03, None],
"4": [0x04, None], "4": [0x04, None], "5": [0x05, None], "5": [0x05, None],
"6": [0x06, None], "6": [0x06, None], "7": [0x07, None], "7": [0x07, None],
"8": [0x08, None], "8": [0x08, None], "9": [0x09, None], "9": [0x09, None],
"A": [0x0A, None], "A": [0x0A, None], "B": [0x0B, None], "B": [0x0B, None],
"C": [0x0C, None], "C": [0x0C, None], "D": [0x0D, None], "D": [0x0D, None],
"E": [0x0E, None], "E": [0x0E, None], "F": [0x0F, None], "F": [0x0F, None],
"G": [0x10, None], "G": [0x10, None], "H": [0x11, None], "H": [0x11, None],
"I": [0x12, None], "I": [0x12, None], "J": [0x13, None], "J": [0x13, None],
"K": [0x14, None], "K": [0x14, None], "L": [0x15, None], "L": [0x15, None],
"M": [0x16, None], "M": [0x16, None], "N": [0x17, None], "N": [0x17, None],
"O": [0x18, None], "O": [0x18, None], "P": [0x19, None], "P": [0x19, None],
"Q": [0x1A, None], "Q": [0x1A, None], "R": [0x1B, None], "R": [0x1B, None],
"S": [0x1C, None], "S": [0x1C, None], "T": [0x1D, None], "T": [0x1D, None],
"U": [0x1E, None], "U": [0x1E, None], "V": [0x1F, None], "V": [0x1F, None],
"W": [0x20, None], "W": [0x20, None], "X": [0x21, None], "X": [0x21, None],
"Y": [0x22, None], "Y": [0x22, None], "Z": [0x23, None], "Z": [0x23, None],
"a": [0x24, None], "b": [0x25, None], "c": [0x26, None], "d": [0x27, None],
"e": [0x28, None], "f": [0x29, None], "g": [0x2A, None], "h": [0x2B, None],
"i": [0x2C, None], "j": [0x2D, None], "k": [0x2E, None], "l": [0x2F, None],
"m": [0x30, None], "n": [0x31, None], "o": [0x32, None], "p": [0x33, None],
"q": [0x34, None], "r": [0x35, None], "s": [0x36, None], "t": [0x37, None],
"u": [0x38, None], "v": [0x39, None], "w": [0x3A, None], "x": [0x3B, None],
"y": [0x3C, None], "z": [0x3D, None], "'": [0x3E, None], ".": [0x3F, None],
# "☺": [0x40, 0x40],
"あ": [0x40, None], "い": [0x41, None], "う": [0x42, None],
"え": [0x43, None], "お": [0x44, None], "か": [0x45, None], "き": [0x46, None],
"く": [0x47, None], "け": [0x48, None], "こ": [0x49, None], "さ": [0x4A, None],
"し": [0x4B, None], "す": [0x4C, None], "せ": [0x4D, None], "そ": [0x4E, None],
"た": [0x4F, None], "ち": [0x50, None], "つ": [0x51, None], "て": [0x52, None],
"と": [0x53, None], "な": [0x54, None], "に": [0x55, None], "ぬ": [0x56, None],
"ね": [0x57, None], "の": [0x58, None], "は": [0x59, None], "ひ": [0x5A, None],
"ふ": [0x5B, None], "へ": [0x5C, None], "ほ": [0x5D, None], "ま": [0x5E, None],
"み": [0x5F, None], "む": [0x60, None], "め": [0x61, None], "も": [0x62, None],
"や": [0x63, None], "ゆ": [0x64, None], "よ": [0x65, None], "ら": [0x66, None],
"り": [0x67, None], "る": [0x68, None], "れ": [0x69, None], "ろ": [0x6A, None],
"わ": [0x6B, None], "を": [0x6C, None], "ん": [0x6D, None], "。": [0x6E, None],
",": [0x6F, None], "、": [0x6F, None], "ア": [0x70, None], "イ": [0x71, None],
"ウ": [0x72, None], "エ": [0x73, None], "オ": [0x74, None], "カ": [0x75, None],
"キ": [0x76, None], "ク": [0x77, None], "ケ": [0x78, None], "コ": [0x79, None],
"サ": [0x7A, None], "シ": [0x7B, None], "ス": [0x7C, None], "セ": [0x7D, None],
"ソ": [0x7E, None],
"タ": [0x7F, None],
"チ": [0x80, None],
"ツ": [0x81, None],
"テ": [0x82, None],
"ト": [0x83, None],
"ナ": [0x84, None],
"ニ": [0x85, None],
"ヌ": [0x86, None],
"ネ": [0x87, None],
"ノ": [0x88, None],
"ハ": [0x89, None],
"ヒ": [0x8A, None],
"フ": [0x8B, None],
"ヘ": [0x8C, None],
"ホ": [0x8D, None],
"マ": [0x8E, None],
"ミ": [0x8F, None],
"ム": [0x90, None],
"メ": [0x91, None],
"モ": [0x92, None],
"ヤ": [0x93, None],
"ユ": [0x94, None],
"ヨ": [0x95, None],
"ラ": [0x96, None],
"リ": [0x97, None],
"ル": [0x98, None],
"レ": [0x99, None],
"ロ": [0x9A, None],
"ワ": [0x9B, None],
"ヲ": [0x9C, None],
"ン": [0x9D, None],
" ": [0x9E, None],
" ": [0x9E, None],
"-": [0x9F, None],
"ー": [0x9F, None],
"ぇ": [0xA0, None],
"っ": [0xA1, None],
"ゃ": [0xA2, None],
"ゅ": [0xA3, None],
"ょ": [0xA4, None],
"ぁ": [0xA5, None],
"ぃ": [0xA6, None],
"ぅ": [0xA7, None],
"ぉ": [0xA8, None],
"ェ": [0xD0, None],
"ッ": [0xD1, None],
"ャ": [0xD2, None],
"ュ": [0xD3, None],
"ョ": [0xD4, None],
"ァ": [0xD5, None],
"ィ": [0xD6, None],
"ゥ": [0xD7, None],
"ォ": [0xD8, None],
"(": [0xE1, None],
"(": [0xE1, None],
")(": [0xE2, None],
")(": [0xE2, None],
")": [0xE3, None],
")": [0xE3, None],
"+": [0xE4, None],
"↔": [0xE4, None],
"&": [0xE5, None],
":": [0xE6, None],
"゛": [0xF0, None],
"゜": [0xF1, None],
"!": [0xF2, None],
"!": [0xF2, None],
"%": [0xF3, None],
"%": [0xF3, None],
"?": [0xF4, None],
"?": [0xF4, None],
# "『": [0xF5, None],
# "』": [0xF6, None],
"~": [0xF7, None],
"~": [0xF7, None],
"…": [0xF8, None],
"$": [0xF9, None],
# "★": [0xFA, None],
# "×": [0xFB, None],
# "・": [0xFC, None],
# "☆": [0xFD, None],
"が": [0xF0, 0xF0],
"ぎ": [0xF0, 0xF0],
"ぐ": [0xF0, 0xF0],
"げ": [0xF0, 0xF0],
"ご": [0xF0, 0xF0],
"ざ": [0xF0, 0xF0],
"じ": [0xF0, 0xF0],
"ず": [0xF0, 0xF0],
"ぜ": [0xF0, 0xF0],
"ぞ": [0xF0, 0xF0],
"だ": [0xF0, 0xF0],
"ぢ": [0xF0, 0xF0],
"づ": [0xF0, 0xF0],
"で": [0xF0, 0xF0],
"ど": [0xF0, 0xF0],
"ば": [0xF0, 0xF0],
"び": [0xF0, 0xF0],
"ぶ": [0xF0, 0xF0],
"べ": [0xF0, 0xF0],
"ぼ": [0xF0, 0xF0],
"ガ": [0xF0, 0xF0],
"ギ": [0xF0, 0xF0],
"グ": [0xF0, 0xF0],
"ゲ": [0xF0, 0xF0],
"ゴ": [0xF0, 0xF0],
"ザ": [0xF0, 0xF0],
"ジ": [0xF0, 0xF0],
"ズ": [0xF0, 0xF0],
"ゼ": [0xF0, 0xF0],
"ゾ": [0xF0, 0xF0],
"ダ": [0xF0, 0xF0],
"ヂ": [0xF0, 0xF0],
"ヅ": [0xF0, 0xF0],
"デ": [0xF0, 0xF0],
"ド": [0xF0, 0xF0],
"バ": [0xF0, 0xF0],
"ビ": [0xF0, 0xF0],
"ブ": [0xF0, 0xF0],
"ベ": [0xF0, 0xF0],
"ボ": [0xF0, 0xF0],
"ぱ": [0xF1, 0xF1],
"ぴ": [0xF1, 0xF1],
"ぷ": [0xF1, 0xF1],
"ぺ": [0xF1, 0xF1],
"ぽ": [0xF1, 0xF1],
"パ": [0xF1, 0xF1],
"ピ": [0xF1, 0xF1],
"プ": [0xF1, 0xF1],
"ペ": [0xF1, 0xF1],
"ポ": [0xF1, 0xF1],
"^": [0x50, None],
"|": [0x51, None],
"<": [0x52, None],
">": [0x53, None],
"/": [0xD0, None],
"î": [0xA1, None],
"ï": [0xA2, None],
"ß": [0xEC, None],
"Ç": [0xED, None],
"ç": [0xEE, None],
"„": [0xF0, None],
chr(225): [112, None],
chr(233): [113, None],
chr(237): [114, None],
chr(243): [115, None],
chr(250): [116, None],
chr(193): [117, None],
chr(201): [118, None],
chr(205): [119, None],
chr(211): [120, None],
chr(218): [121, None],
chr(241): [122, None],
chr(209): [123, None],
chr(252): [124, None],
chr(220): [125, None],
chr(191): [126, None],
chr(161): [127, None],
}
def getCharID(txt):
return charmap[txt][0] if txt in charmap else None
def getTranslatedText(txta):
txt = list(txta)
cid = 0
strSize = len(txt)
tmp = ""
shiftArr = 0
tmpId = 0
tmpIcon = ""
tmpSpecialChar = ""
for cid in range(0, len(txt)):
ch = txt[cid]
if(ch == '['):
tmpIcon[0] = ch
tmpIcon[1] = txt[cid + 1]
tmpIcon[2] = txt[cid + 2]
if tmpIcon.join() in charmap:
ctm = charmap[tmpIcon.join()]
shiftArr += 2
cid += 2
for cl in range(0, 2):
if(ctm.value[cl] != None):
tmp[cid - shiftArr + cl] = ctm.value[cl]
shiftArr-=cl
elif(ch == '{'):
tmpSpecialChar[0] = ch
tmpSpecialChar[1] = txt[cid + 1]
tmpSpecialChar[2] = txt[cid + 2]
tmpSpecialChar[3] = txt[cid + 3]
tmpSpecialChar[4] = txt[cid + 4]
tmpSpecialChar[5] = txt[cid + 5]
tmpSpecialChar[6] = txt[cid + 6]
if tmpIcon.join() in charmap:
ctm = charmap[tmpIcon.join()]
shiftArr += 5
cid += 5
for cl in range(0, 2):
if(ctm.value[cl] != None):
tmp[cid - shiftArr + cl] = ctm.value[cl]
shiftArr-=cl
else:
findTxt = [ch]
if tmpIcon.join() in charmap:
ctm = charmap[tmpIcon.join()]
tmp[cid - shiftArr] = ctm.value[0]
else:
tmp[cid - shiftArr] = 0x9E
tmp[strSize - shiftArr] = 0xFF
return tmp