forked from ecraven/g13
-
Notifications
You must be signed in to change notification settings - Fork 1
/
g13_fonts.cc
422 lines (404 loc) · 20.9 KB
/
g13_fonts.cc
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
#include "g13.h"
using namespace std;
namespace G13 {
// font data from https://github.com/dhepper/font8x8
// Constant: font8x8_basic
// Contains an 8x8 font map for unicode points U+0000 - U+007F (basic latin)
unsigned char font8x8_basic[128][8] = {
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0000 (nul)
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0001
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0002
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0003
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0004
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0005
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0006
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0007
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0008
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0009
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000A
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000B
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000C
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000D
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000E
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000F
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0010
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0011
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0012
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0013
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0014
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0015
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0016
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0017
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0018
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0019
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001A
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001B
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001C
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001D
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001E
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001F
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0020 (space)
{ 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00}, // U+0021 (!)
{ 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0022 (")
{ 0x36, 0x36, 0x7F, 0x36, 0x7F, 0x36, 0x36, 0x00}, // U+0023 (#)
{ 0x0C, 0x3E, 0x03, 0x1E, 0x30, 0x1F, 0x0C, 0x00}, // U+0024 ($)
{ 0x00, 0x63, 0x33, 0x18, 0x0C, 0x66, 0x63, 0x00}, // U+0025 (%)
{ 0x1C, 0x36, 0x1C, 0x6E, 0x3B, 0x33, 0x6E, 0x00}, // U+0026 (&)
{ 0x06, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0027 (')
{ 0x18, 0x0C, 0x06, 0x06, 0x06, 0x0C, 0x18, 0x00}, // U+0028 (()
{ 0x06, 0x0C, 0x18, 0x18, 0x18, 0x0C, 0x06, 0x00}, // U+0029 ())
{ 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00}, // U+002A (*)
{ 0x00, 0x0C, 0x0C, 0x3F, 0x0C, 0x0C, 0x00, 0x00}, // U+002B (+)
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x06}, // U+002C (,)
{ 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00}, // U+002D (-)
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00}, // U+002E (.)
{ 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x00}, // U+002F (/)
{ 0x3E, 0x63, 0x73, 0x7B, 0x6F, 0x67, 0x3E, 0x00}, // U+0030 (0)
{ 0x0C, 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x3F, 0x00}, // U+0031 (1)
{ 0x1E, 0x33, 0x30, 0x1C, 0x06, 0x33, 0x3F, 0x00}, // U+0032 (2)
{ 0x1E, 0x33, 0x30, 0x1C, 0x30, 0x33, 0x1E, 0x00}, // U+0033 (3)
{ 0x38, 0x3C, 0x36, 0x33, 0x7F, 0x30, 0x78, 0x00}, // U+0034 (4)
{ 0x3F, 0x03, 0x1F, 0x30, 0x30, 0x33, 0x1E, 0x00}, // U+0035 (5)
{ 0x1C, 0x06, 0x03, 0x1F, 0x33, 0x33, 0x1E, 0x00}, // U+0036 (6)
{ 0x3F, 0x33, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x00}, // U+0037 (7)
{ 0x1E, 0x33, 0x33, 0x1E, 0x33, 0x33, 0x1E, 0x00}, // U+0038 (8)
{ 0x1E, 0x33, 0x33, 0x3E, 0x30, 0x18, 0x0E, 0x00}, // U+0039 (9)
{ 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x00}, // U+003A (:)
{ 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x06}, // U+003B (//)
{ 0x18, 0x0C, 0x06, 0x03, 0x06, 0x0C, 0x18, 0x00}, // U+003C (<)
{ 0x00, 0x00, 0x3F, 0x00, 0x00, 0x3F, 0x00, 0x00}, // U+003D (=)
{ 0x06, 0x0C, 0x18, 0x30, 0x18, 0x0C, 0x06, 0x00}, // U+003E (>)
{ 0x1E, 0x33, 0x30, 0x18, 0x0C, 0x00, 0x0C, 0x00}, // U+003F (?)
{ 0x3E, 0x63, 0x7B, 0x7B, 0x7B, 0x03, 0x1E, 0x00}, // U+0040 (@)
{ 0x0C, 0x1E, 0x33, 0x33, 0x3F, 0x33, 0x33, 0x00}, // U+0041 (A)
{ 0x3F, 0x66, 0x66, 0x3E, 0x66, 0x66, 0x3F, 0x00}, // U+0042 (B)
{ 0x3C, 0x66, 0x03, 0x03, 0x03, 0x66, 0x3C, 0x00}, // U+0043 (C)
{ 0x1F, 0x36, 0x66, 0x66, 0x66, 0x36, 0x1F, 0x00}, // U+0044 (D)
{ 0x7F, 0x46, 0x16, 0x1E, 0x16, 0x46, 0x7F, 0x00}, // U+0045 (E)
{ 0x7F, 0x46, 0x16, 0x1E, 0x16, 0x06, 0x0F, 0x00}, // U+0046 (F)
{ 0x3C, 0x66, 0x03, 0x03, 0x73, 0x66, 0x7C, 0x00}, // U+0047 (G)
{ 0x33, 0x33, 0x33, 0x3F, 0x33, 0x33, 0x33, 0x00}, // U+0048 (H)
{ 0x1E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+0049 (I)
{ 0x78, 0x30, 0x30, 0x30, 0x33, 0x33, 0x1E, 0x00}, // U+004A (J)
{ 0x67, 0x66, 0x36, 0x1E, 0x36, 0x66, 0x67, 0x00}, // U+004B (K)
{ 0x0F, 0x06, 0x06, 0x06, 0x46, 0x66, 0x7F, 0x00}, // U+004C (L)
{ 0x63, 0x77, 0x7F, 0x7F, 0x6B, 0x63, 0x63, 0x00}, // U+004D (M)
{ 0x63, 0x67, 0x6F, 0x7B, 0x73, 0x63, 0x63, 0x00}, // U+004E (N)
{ 0x1C, 0x36, 0x63, 0x63, 0x63, 0x36, 0x1C, 0x00}, // U+004F (O)
{ 0x3F, 0x66, 0x66, 0x3E, 0x06, 0x06, 0x0F, 0x00}, // U+0050 (P)
{ 0x1E, 0x33, 0x33, 0x33, 0x3B, 0x1E, 0x38, 0x00}, // U+0051 (Q)
{ 0x3F, 0x66, 0x66, 0x3E, 0x36, 0x66, 0x67, 0x00}, // U+0052 (R)
{ 0x1E, 0x33, 0x07, 0x0E, 0x38, 0x33, 0x1E, 0x00}, // U+0053 (S)
{ 0x3F, 0x2D, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+0054 (T)
{ 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3F, 0x00}, // U+0055 (U)
{ 0x33, 0x33, 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x00}, // U+0056 (V)
{ 0x63, 0x63, 0x63, 0x6B, 0x7F, 0x77, 0x63, 0x00}, // U+0057 (W)
{ 0x63, 0x63, 0x36, 0x1C, 0x1C, 0x36, 0x63, 0x00}, // U+0058 (X)
{ 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x0C, 0x1E, 0x00}, // U+0059 (Y)
{ 0x7F, 0x63, 0x31, 0x18, 0x4C, 0x66, 0x7F, 0x00}, // U+005A (Z)
{ 0x1E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x1E, 0x00}, // U+005B ([)
{ 0x03, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x40, 0x00}, // U+005C (\)
{ 0x1E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1E, 0x00}, // U+005D (])
{ 0x08, 0x1C, 0x36, 0x63, 0x00, 0x00, 0x00, 0x00}, // U+005E (^)
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF}, // U+005F (_)
{ 0x0C, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0060 (`)
{ 0x00, 0x00, 0x1E, 0x30, 0x3E, 0x33, 0x6E, 0x00}, // U+0061 (a)
{ 0x07, 0x06, 0x06, 0x3E, 0x66, 0x66, 0x3B, 0x00}, // U+0062 (b)
{ 0x00, 0x00, 0x1E, 0x33, 0x03, 0x33, 0x1E, 0x00}, // U+0063 (c)
{ 0x38, 0x30, 0x30, 0x3e, 0x33, 0x33, 0x6E, 0x00}, // U+0064 (d)
{ 0x00, 0x00, 0x1E, 0x33, 0x3f, 0x03, 0x1E, 0x00}, // U+0065 (e)
{ 0x1C, 0x36, 0x06, 0x0f, 0x06, 0x06, 0x0F, 0x00}, // U+0066 (f)
{ 0x00, 0x00, 0x6E, 0x33, 0x33, 0x3E, 0x30, 0x1F}, // U+0067 (g)
{ 0x07, 0x06, 0x36, 0x6E, 0x66, 0x66, 0x67, 0x00}, // U+0068 (h)
{ 0x0C, 0x00, 0x0E, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+0069 (i)
{ 0x30, 0x00, 0x30, 0x30, 0x30, 0x33, 0x33, 0x1E}, // U+006A (j)
{ 0x07, 0x06, 0x66, 0x36, 0x1E, 0x36, 0x67, 0x00}, // U+006B (k)
{ 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+006C (l)
{ 0x00, 0x00, 0x33, 0x7F, 0x7F, 0x6B, 0x63, 0x00}, // U+006D (m)
{ 0x00, 0x00, 0x1F, 0x33, 0x33, 0x33, 0x33, 0x00}, // U+006E (n)
{ 0x00, 0x00, 0x1E, 0x33, 0x33, 0x33, 0x1E, 0x00}, // U+006F (o)
{ 0x00, 0x00, 0x3B, 0x66, 0x66, 0x3E, 0x06, 0x0F}, // U+0070 (p)
{ 0x00, 0x00, 0x6E, 0x33, 0x33, 0x3E, 0x30, 0x78}, // U+0071 (q)
{ 0x00, 0x00, 0x3B, 0x6E, 0x66, 0x06, 0x0F, 0x00}, // U+0072 (r)
{ 0x00, 0x00, 0x3E, 0x03, 0x1E, 0x30, 0x1F, 0x00}, // U+0073 (s)
{ 0x08, 0x0C, 0x3E, 0x0C, 0x0C, 0x2C, 0x18, 0x00}, // U+0074 (t)
{ 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x6E, 0x00}, // U+0075 (u)
{ 0x00, 0x00, 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x00}, // U+0076 (v)
{ 0x00, 0x00, 0x63, 0x6B, 0x7F, 0x7F, 0x36, 0x00}, // U+0077 (w)
{ 0x00, 0x00, 0x63, 0x36, 0x1C, 0x36, 0x63, 0x00}, // U+0078 (x)
{ 0x00, 0x00, 0x33, 0x33, 0x33, 0x3E, 0x30, 0x1F}, // U+0079 (y)
{ 0x00, 0x00, 0x3F, 0x19, 0x0C, 0x26, 0x3F, 0x00}, // U+007A (z)
{ 0x38, 0x0C, 0x0C, 0x07, 0x0C, 0x0C, 0x38, 0x00}, // U+007B ({)
{ 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00}, // U+007C (|)
{ 0x07, 0x0C, 0x0C, 0x38, 0x0C, 0x0C, 0x07, 0x00}, // U+007D (})
{ 0x6E, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+007E (~)
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // U+007F
};
unsigned char font5x8[][5] = {
{ 0x00, 0x00, 0x00, 0x00, 0x00 }, // 0x20 (Space)
{ 0x00, 0x00, 0x9E, 0x00, 0x00 }, // 0x21 !
{ 0x00, 0x0E, 0x00, 0x0E, 0x00 },// 0x22 "
{ 0x28, 0xFE, 0x28, 0xFE, 0x28 },// 0x23 #
{ 0x48, 0x54, 0xFE, 0x54, 0x24 },// 0x24 $
{ 0x46, 0x26, 0x10, 0xC8, 0xC4 },// 0x25 %
{ 0x6C, 0x92, 0xAA, 0x44, 0xA0 },// 0x26 &
{ 0x00, 0x0A, 0x06, 0x00, 0x00 },// 0x27 '
{ 0x00, 0x38, 0x44, 0x82, 0x00 },// 0x28 (
{ 0x00, 0x82, 0x44, 0x38, 0x00 },// 0x29 )
{ 0x10, 0x54, 0x38, 0x54, 0x10 },// 0x2A *
{ 0x10, 0x10, 0x7C, 0x10, 0x10 },// 0x2B +
{ 0x00, 0xA0, 0x60, 0x00, 0x00 },// 0x2C ,
{ 0x10, 0x10, 0x10, 0x10, 0x10 },// 0x2D -
{ 0x00, 0x60, 0x60, 0x00, 0x00 },// 0x2E .
{ 0x40, 0x20, 0x10, 0x08, 0x04 },// 0x2F /
{ 0x7C, 0xA2, 0x92, 0x8A, 0x7C },// 0x30 0
{ 0x00, 0x84, 0xFE, 0x80, 0x00 },// 0x31 1
{ 0x84, 0xC2, 0xA2, 0x92, 0x8C },// 0x32 2
{ 0x42, 0x82, 0x8A, 0x96, 0x62 },// 0x33 3
{ 0x30, 0x28, 0x24, 0xFE, 0x20 },// 0x34 4
{ 0x4E, 0x8A, 0x8A, 0x8A, 0x72 },// 0x35 5
{ 0x78, 0x94, 0x92, 0x92, 0x60 },// 0x36 6
{ 0x02, 0xE2, 0x12, 0x0A, 0x06 },// 0x37 7
{ 0x6C, 0x92, 0x92, 0x92, 0x6C },// 0x38 8
{ 0x0C, 0x92, 0x92, 0x52, 0x3C },// 0x39 9
{ 0x00, 0x6C, 0x6C, 0x00, 0x00 },// 0x3A :
{ 0x00, 0xAC, 0x6C, 0x00, 0x00 },// 0x3B ;
{ 0x00, 0x10, 0x28, 0x44, 0x82 },// 0x3C <
{ 0x28, 0x28, 0x28, 0x28, 0x28 },// 0x3D =
{ 0x82, 0x44, 0x28, 0x10, 0x00 },// 0x3E >
{ 0x04, 0x02, 0xA2, 0x12, 0x0C },// 0x3F ?
{ 0x64, 0x92, 0xF2, 0x82, 0x7C },// 0x40 @
{ 0xFC, 0x22, 0x22, 0x22, 0xFC },// 0x41 A
{ 0xFE, 0x92, 0x92, 0x92, 0x6C },// 0x42 B
{ 0x7C, 0x82, 0x82, 0x82, 0x44 },// 0x43 C
{ 0xFE, 0x82, 0x82, 0x44, 0x38 },// 0x44 D
{ 0xFE, 0x92, 0x92, 0x92, 0x82 },// 0x45 E
{ 0xFE, 0x12, 0x12, 0x02, 0x02 },// 0x46 F
{ 0x7C, 0x82, 0x82, 0xA2, 0x64 },// 0x47 G
{ 0xFE, 0x10, 0x10, 0x10, 0xFE },// 0x48 H
{ 0x00, 0x82, 0xFE, 0x82, 0x00 },// 0x49 I
{ 0x40, 0x80, 0x82, 0x7E, 0x02 },// 0x4A J
{ 0xFE, 0x10, 0x28, 0x44, 0x82 },// 0x4B K
{ 0xFE, 0x80, 0x80, 0x80, 0x80 },// 0x4C L
{ 0xFE, 0x04, 0x08, 0x04, 0xFE },// 0x4D M
{ 0xFE, 0x08, 0x10, 0x20, 0xFE },// 0x4E N
{ 0x7C, 0x82, 0x82, 0x82, 0x7C },// 0x4F O
{ 0xFE, 0x12, 0x12, 0x12, 0x0C },// 0x50 P
{ 0x7C, 0x82, 0xA2, 0x42, 0xBC },// 0x51 Q
{ 0xFE, 0x12, 0x32, 0x52, 0x8C },// 0x52 R
{ 0x8C, 0x92, 0x92, 0x92, 0x62 },// 0x53 S
{ 0x02, 0x02, 0xFE, 0x02, 0x02 },// 0x54 T
{ 0x7E, 0x80, 0x80, 0x80, 0x7E },// 0x55 U
{ 0x3E, 0x40, 0x80, 0x40, 0x3E },// 0x56 V
{ 0xFE, 0x40, 0x30, 0x40, 0xFE },// 0x57 W
{ 0xC6, 0x28, 0x10, 0x28, 0xC6 },// 0x58 X
{ 0x06, 0x08, 0xF0, 0x08, 0x06 },// 0x59 Y
{ 0xC2, 0xA2, 0x92, 0x8A, 0x86 },// 0x5A Z
{ 0x00, 0x00, 0xFE, 0x82, 0x82 },// 0x5B [
{ 0x04, 0x08, 0x10, 0x20, 0x40 },// 0x5C "\"
{ 0x82, 0x82, 0xFE, 0x00, 0x00 },// 0x5D ]
{ 0x08, 0x04, 0x02, 0x04, 0x08 },// 0x5E ^
{ 0x80, 0x80, 0x80, 0x80, 0x80 },// 0x5F _
{ 0x00, 0x02, 0x04, 0x08, 0x00 },// 0x60 `
{ 0x40, 0xA8, 0xA8, 0xA8, 0xF0 },// 0x61 a
{ 0xFE, 0x90, 0x88, 0x88, 0x70 },// 0x62 b
{ 0x70, 0x88, 0x88, 0x88, 0x40 },// 0x63 c
{ 0x70, 0x88, 0x88, 0x90, 0xFE },// 0x64 d
{ 0x70, 0xA8, 0xA8, 0xA8, 0x30 },// 0x65 e
{ 0x10, 0xFC, 0x12, 0x02, 0x04 },// 0x66 f
{ 0x10, 0x28, 0xA8, 0xA8, 0x78 },// 0x67 g
{ 0xFE, 0x10, 0x08, 0x08, 0xF0 },// 0x68 h
{ 0x00, 0x88, 0xFA, 0x80, 0x00 },// 0x69 i
{ 0x40, 0x80, 0x88, 0x7A, 0x00 },// 0x6A j
{ 0x00, 0xFE, 0x20, 0x50, 0x88 },// 0x6B k
{ 0x00, 0x82, 0xFE, 0x80, 0x00 },// 0x6C l
{ 0xF8, 0x08, 0x30, 0x08, 0xF0 },// 0x6D m
{ 0xF8, 0x10, 0x08, 0x08, 0xF0 },// 0x6E n
{ 0x70, 0x88, 0x88, 0x88, 0x70 },// 0x6F o
{ 0xF8, 0x28, 0x28, 0x28, 0x10 },// 0x70 p
{ 0x10, 0x28, 0x28, 0x30, 0xF8 },// 0x71 q
{ 0xF8, 0x10, 0x08, 0x08, 0x10 },// 0x72 r
{ 0x90, 0xA8, 0xA8, 0xA8, 0x40 },// 0x73 s
{ 0x08, 0x7E, 0x88, 0x80, 0x40 },// 0x74 t
{ 0x78, 0x80, 0x80, 0x40, 0xF8 },// 0x75 u
{ 0x38, 0x40, 0x80, 0x40, 0x38 },// 0x76 v
{ 0x78, 0x80, 0x60, 0x80, 0x78 },// 0x77 w
{ 0x88, 0x50, 0x20, 0x50, 0x88 },// 0x78 x
{ 0x18, 0xA0, 0xA0, 0xA0, 0x78 },// 0x79 y
{ 0x88, 0xC8, 0xA8, 0x98, 0x88 },// 0x7A z
{ 0x00, 0x10, 0x6C, 0x82, 0x00 },// 0x7B {
{ 0x00, 0x00, 0xFE, 0x00, 0x00 },// 0x7C |
{ 0x00, 0x82, 0x6C, 0x10, 0x00 },// 0x7D }
{ 0x20, 0x10, 0x10, 0x20, 0x10 },// 0x7E
{ 0xF0, 0x88, 0x84, 0x88, 0xF0 },// 0x7F
{ 0x28, 0x7C, 0xAA, 0x82, 0x44 },// 0x80 €
{ 0xF0, 0x29, 0x27, 0x21, 0xFF },// 0x81
{ 0x00, 0xA0, 0x60, 0x00, 0x00 },// 0x82 ‚
{ 0x40, 0x90, 0x7C, 0x12, 0x04 },// 0x83 ƒ
{ 0xC0, 0xA0, 0x00, 0xC0, 0xA0 },// 0x84 „
{ 0x80, 0x00, 0x80, 0x00, 0x80 },// 0x85 …
{ 0x00, 0x04, 0xFE, 0x04, 0x00 },// 0x86 †
{ 0x00, 0x44, 0xFE, 0x44, 0x00 },// 0x87 ‡
{ 0x00, 0x04, 0x02, 0x04, 0x00 },// 0x88 ˆ
{ 0xC3, 0xD3, 0x08, 0xC4, 0xC2 },// 0x89 ‰
{ 0x4C, 0x93, 0x92, 0x93, 0x64 },// 0x8A Š
{ 0x00, 0x10, 0x28, 0x00, 0x00 },// 0x8B ‹
{ 0x7C, 0x82, 0x82, 0x7C, 0x92 },// 0x8C Œ
{ 0x02, 0xFE, 0x90, 0x90, 0x60 },// 0x8D
{ 0xC2, 0xA3, 0x92, 0x8B, 0x86 },// 0x8E Ž
{ 0x44, 0x92, 0x8A, 0x92, 0x7C },// 0x8F
{ 0x70, 0x88, 0x90, 0x60, 0x98 },// 0x90
{ 0x00, 0x02, 0x04, 0x08, 0x00 },// 0x91 ‘
{ 0x00, 0x08, 0x04, 0x02, 0x00 },// 0x92 ’
{ 0x02, 0x04, 0x0A, 0x04, 0x08 },// 0x93 “
{ 0x08, 0x04, 0x0A, 0x04, 0x02 },// 0x94 ”
{ 0x00, 0x38, 0x38, 0x38, 0x00 },// 0x95 •
{ 0x00, 0x10, 0x10, 0x10, 0x10 },// 0x96 –
{ 0x10, 0x10, 0x10, 0x10, 0x10 },// 0x97 —
{ 0x02, 0x01, 0x02, 0x04, 0x02 },// 0x98 ˜
{ 0xF1, 0x5B, 0x55, 0x51, 0x51 },// 0x99 ™
{ 0x90, 0xA9, 0xAA, 0xA9, 0x40 },// 0x9A š
{ 0x00, 0x88, 0x50, 0x20, 0x00 },// 0x9B ›
{ 0x70, 0x88, 0x70, 0xA8, 0xB0 },// 0x9C ϡ
{ 0x38, 0x7C, 0xF8, 0x7C, 0x38 },// 0x9D
{ 0x88, 0xC9, 0xAA, 0x99, 0x88 },// 0x9E ž
{ 0x1C, 0x21, 0xC0, 0x21, 0x1C },// 0x9F Ÿ
{ 0x00, 0x00, 0x00, 0x00, 0x00 },// 0xA0
{ 0x00, 0x00, 0xF2, 0x00, 0x00 },// 0xA1 ¡
{ 0x38, 0x44, 0xFE, 0x44, 0x20 },// 0xA2 ¢
{ 0x90, 0x7C, 0x92, 0x82, 0x40 },// 0xA3 £
{ 0x44, 0x38, 0x28, 0x38, 0x44 },// 0xA4 ¤
{ 0x2A, 0x2C, 0xF8, 0x2C, 0x2A },// 0xA5 ¥
{ 0x00, 0x00, 0xEE, 0x00, 0x00 },// 0xA6 ¦
{ 0x40, 0x94, 0xAA, 0x52, 0x04 },// 0xA7 §
{ 0x00, 0x02, 0x00, 0x02, 0x00 },// 0xA8 ¨
{ 0xFE, 0x82, 0xBA, 0x92, 0xFE },// 0xA9 ©
{ 0x90, 0xAA, 0xAA, 0xAA, 0xBC },// 0xAA ª
{ 0x20, 0x50, 0xA8, 0x50, 0x88 },// 0xAB «
{ 0x20, 0x20, 0x20, 0x20, 0xE0 },// 0xAC ¬
{ 0x20, 0x20, 0x20, 0x20, 0x20 },// 0xAD
{ 0xFE, 0x82, 0xCA, 0xA2, 0xFE },// 0xAE ®
{ 0x02, 0x02, 0x02, 0x02, 0x02 },// 0xAF ¯
{ 0x0E, 0x11, 0x11, 0x0E, 0x00 },// 0xB0 °
{ 0x88, 0x88, 0xBE, 0x88, 0x88 },// 0xB1 ±
{ 0x12, 0x19, 0x15, 0x12, 0x00 },// 0xB2 ²
{ 0x11, 0x15, 0x15, 0x0A, 0x00 },// 0xB3 ³
{ 0x00, 0x08, 0x04, 0x02, 0x00 },// 0xB4 ´
{ 0xFE, 0x20, 0x20, 0x10, 0x3E },// 0xB5 µ
{ 0x0C, 0x12, 0x12, 0xFE, 0xFE },// 0xB6 ¶
{ 0x00, 0x30, 0x30, 0x00, 0x00 },// 0xB7 ·
{ 0x00, 0x80, 0xB0, 0x40, 0x00 },// 0xB8 ¸
{ 0x00, 0x02, 0x0F, 0x00, 0x00 },// 0xB9 ¹
{ 0x00, 0x02, 0x05, 0x02, 0x00 },// 0xBA º
{ 0x44, 0x28, 0x54, 0x28, 0x10 },// 0xBB »
{ 0x22, 0x1F, 0x68, 0x54, 0xFA },// 0xBC ¼
{ 0x02, 0x1F, 0x90, 0xC8, 0xB0 },// 0xBD ½
{ 0x15, 0x1F, 0x60, 0x50, 0xF8 },// 0xBE ¾
{ 0x60, 0x90, 0x8A, 0x80, 0x40 },// 0xBF ¿
{ 0xF0, 0x29, 0x26, 0x28, 0xF0 },// 0xC0 À
{ 0xF0, 0x28, 0x26, 0x29, 0xF0 },// 0xC1 Á
{ 0xF0, 0x2A, 0x29, 0x2A, 0xF0 },// 0xC2 Â
{ 0xF2, 0x29, 0x29, 0x2A, 0xF1 },// 0xC3 Ã
{ 0xF0, 0x29, 0x24, 0x29, 0xF0 },// 0xC4 Ä
{ 0xF0, 0x2A, 0x2D, 0x2A, 0xF0 },// 0xC5 Å
{ 0xF8, 0x24, 0xFE, 0x92, 0x92 },// 0xC6 Æ
{ 0x1E, 0x21, 0xA1, 0xE1, 0x12 },// 0xC7 Ç
{ 0xF8, 0xA9, 0xAA, 0xA8, 0x88 },// 0xC8 È
{ 0xF8, 0xA8, 0xAA, 0xA9, 0x88 },// 0xC9 É
{ 0xF8, 0xAA, 0xA9, 0xAA, 0x88 },// 0xCA Ê
{ 0xF8, 0xAA, 0xA8, 0xAA, 0x88 },// 0xCB Ë
{ 0x00, 0x89, 0xFA, 0x88, 0x00 },// 0xCC Ì
{ 0x00, 0x88, 0xFA, 0x89, 0x00 },// 0xCD Í
{ 0x00, 0x8A, 0xF9, 0x8A, 0x00 },// 0xCE Î
{ 0x00, 0x8A, 0xF8, 0x8A, 0x00 },// 0xCF Ï
{ 0x10, 0xFE, 0x92, 0x82, 0x7C },// 0xD0 Ð
{ 0xFA, 0x11, 0x21, 0x42, 0xF9 },// 0xD1 Ñ
{ 0x78, 0x85, 0x86, 0x84, 0x78 },// 0xD2 Ò
{ 0x78, 0x84, 0x86, 0x85, 0x78 },// 0xD3 Ó
{ 0x70, 0x8A, 0x89, 0x8A, 0x70 },// 0xD4 Ô
{ 0x72, 0x89, 0x89, 0x8A, 0x71 },// 0xD5 Õ
{ 0x78, 0x85, 0x84, 0x85, 0x78 },// 0xD6 Ö
{ 0x44, 0x28, 0x10, 0x28, 0x44 },// 0xD7 ×
{ 0x10, 0xAA, 0xFE, 0xAA, 0x10 },// 0xD8 Ø
{ 0x7C, 0x81, 0x82, 0x80, 0x7C },// 0xD9 Ù
{ 0x7C, 0x80, 0x82, 0x81, 0x7C },// 0xDA Ú
{ 0x78, 0x82, 0x81, 0x82, 0x78 },// 0xDB Û
{ 0x7C, 0x81, 0x80, 0x81, 0x7C },// 0xDC Ü
{ 0x04, 0x08, 0xF2, 0x09, 0x04 },// 0xDD Ý
{ 0x81, 0xFF, 0x24, 0x24, 0x18 },// 0xDE Þ
{ 0x80, 0x7C, 0x92, 0x92, 0x6C },// 0xDF ß
{ 0x40, 0xA9, 0xAA, 0xA8, 0xF0 },// 0xE0 à
{ 0x40, 0xA8, 0xAA, 0xA9, 0xF0 },// 0xE1 á
{ 0x40, 0xAA, 0xA9, 0xAA, 0xF0 },// 0xE2 â
{ 0x42, 0xA9, 0xA9, 0xAA, 0xF1 },// 0xE3 ã
{ 0x40, 0xAA, 0xA8, 0xAA, 0xF0 },// 0xE4 ä
{ 0x40, 0xAA, 0xAD, 0xAA, 0xF0 },// 0xE5 å
{ 0x64, 0x94, 0x78, 0x94, 0x58 },// 0xE6 æ
{ 0x18, 0x24, 0xA4, 0xE4, 0x10 },// 0xE7 ç
{ 0x70, 0xA9, 0xAA, 0xA8, 0x30 },// 0xE8 è
{ 0x70, 0xA8, 0xAA, 0xA9, 0x30 },// 0xE9 é
{ 0x70, 0xAA, 0xA9, 0xAA, 0x30 },// 0xEA ê
{ 0x70, 0xAA, 0xA8, 0xAA, 0x30 },// 0xEB ë
{ 0x00, 0x91, 0xFA, 0x80, 0x00 },// 0xEC ì
{ 0x00, 0x90, 0xFA, 0x81, 0x00 },// 0xED í
{ 0x00, 0x92, 0xF9, 0x82, 0x00 },// 0xEE î
{ 0x00, 0x92, 0xF8, 0x82, 0x00 },// 0xEF ï
{ 0x4A, 0xA4, 0xAA, 0xB0, 0x60 },// 0xF0 ð
{ 0xFA, 0x11, 0x09, 0x0A, 0xF1 },// 0xF1 ñ
{ 0x70, 0x89, 0x8A, 0x88, 0x70 },// 0xF2 ò
{ 0x70, 0x88, 0x8A, 0x89, 0x70 },// 0xF3 ó
{ 0x60, 0x94, 0x92, 0x94, 0x60 },// 0xF4 ô
{ 0x64, 0x92, 0x92, 0x94, 0x62 },// 0xF5 õ
{ 0x70, 0x8A, 0x88, 0x8A, 0x70 },// 0xF6 ö
{ 0x10, 0x10, 0x54, 0x10, 0x10 },// 0xF7 ÷
{ 0x10, 0xA8, 0x7C, 0x2A, 0x10 },// 0xF8 ø
{ 0x78, 0x81, 0x82, 0x40, 0xF8 },// 0xF9 ù
{ 0x78, 0x80, 0x82, 0x41, 0xF8 },// 0xFA ú
{ 0x78, 0x82, 0x81, 0x42, 0xF8 },// 0xFB û
{ 0x78, 0x82, 0x80, 0x42, 0xF8 },// 0xFC ü
{ 0x18, 0xA0, 0xA4, 0xA2, 0x78 },// 0xFD v
{ 0x00, 0x82, 0xFE, 0xA8, 0x10 },// 0xFE þ
{ 0x18, 0xA2, 0xA0, 0xA2, 0x78 } // 0xFF ÿ
};
G13_Font::G13_Font() : _name("default"), _width(8)
{}
G13_Font::G13_Font( const std::string &name, unsigned int width ) :_name(name), _width(width)
{
}
void G13_FontChar::set_character( unsigned char *data, int width, unsigned flags ) {
unsigned char *dest = bits_regular;
memset( dest, 0, CHAR_BUF_SIZE );
if( flags && FF_ROTATE ) {
for( int x = 0; x < width; x++ ) {
unsigned char x_mask = 1 << x;
for( int y = 0; y < 8; y++ ) {
unsigned char y_mask = 1 << y;
if( data[y] & x_mask ) {
dest[x] |= 1 << y;
}
}
}
} else {
memcpy( dest, data, width );
}
for( int x = 0; x < width; x++ ) {
bits_inverted[x] = ~dest[x];
}
}
template <typename T, int size>
int GetFontCharacterCount( T(&)[size] ) { return size; }
template < class ARRAY_T, class FLAGST >
void G13_Font::install_font( ARRAY_T &data, FLAGST flags, int first ) {
for( size_t i = 0; i < GetFontCharacterCount(data); i++ ) {
_chars[i+first].set_character( &data[i][0], _width, flags );
}
}
void G13_Device::_init_fonts() {
_current_font = FontPtr( new G13_Font("8x8",8) );
_fonts[_current_font->name()] = _current_font;
_current_font->install_font( font8x8_basic, G13_FontChar::FF_ROTATE, 0 );
FontPtr fiveXeight( new G13_Font("5x8",5) );
fiveXeight->install_font( font5x8, 0, 32 );
_fonts[fiveXeight->name()] = fiveXeight;
}
} // namespace G13