6#include "TinyGPU/Color/RGB565.h"
7#include "TinyGPU/Color/RGB888.h"
8#include "TinyGPU/Font/BitmapFont.h"
13
14
15
16
17
18
19
20
21
22template <
typename RGB_T =
RGB565>
27 using Glyph =
typename Base::Glyph;
28 using CodePoint =
typename Base::CodePoint;
44 const Glyph&
glyph(CodePoint codePoint)
const override {
45 const Glyph* mappedGlyph = glyphForExtendedCodePoint(codePoint);
46 return mappedGlyph !=
nullptr ? *mappedGlyph : Base::glyph(codePoint);
53 const Glyph* asciiGlyphPtr(
char character)
const {
54 return &Base::glyph(character);
57 const Glyph* glyphForExtendedCodePoint(CodePoint codePoint)
const {
64 return asciiGlyphPtr(
',');
67 return asciiGlyphPtr(
'f');
70 return asciiGlyphPtr(
'"');
73 return asciiGlyphPtr(
'.');
78 return asciiGlyphPtr(
'+');
81 return asciiGlyphPtr(
'^');
84 return asciiGlyphPtr(
'%');
87 return asciiGlyphPtr(
'S');
90 return asciiGlyphPtr(
'<');
93 return asciiGlyphPtr(
'O');
96 return asciiGlyphPtr(
'Z');
101 return asciiGlyphPtr(
'\'');
106 return asciiGlyphPtr(
'"');
109 return bulletGlyphPtr();
114 return asciiGlyphPtr(
'-');
117 return asciiGlyphPtr(
'~');
120 return asciiGlyphPtr(
'T');
123 return asciiGlyphPtr(
's');
126 return asciiGlyphPtr(
'>');
129 return asciiGlyphPtr(
'o');
132 return asciiGlyphPtr(
'z');
135 return asciiGlyphPtr(
'Y');
137 return asciiGlyphPtr(
' ');
139 return asciiGlyphPtr(
'!');
143 return &sterlingGlyph();
145 return asciiGlyphPtr(
'$');
149 return asciiGlyphPtr(
'|');
151 return §ionGlyph();
153 return asciiGlyphPtr(
'"');
155 return ©rightGlyph();
157 return asciiGlyphPtr(
'a');
159 return asciiGlyphPtr(
'<');
163 return asciiGlyphPtr(
'-');
165 return asciiGlyphPtr(
'R');
167 return asciiGlyphPtr(
'-');
169 return °reeGlyph();
171 return &plusMinusGlyph();
173 return asciiGlyphPtr(
'2');
175 return asciiGlyphPtr(
'3');
177 return asciiGlyphPtr(
'\'');
179 return µGlyph();
181 return ¶graphGlyph();
183 return bulletGlyphPtr();
185 return asciiGlyphPtr(
',');
187 return asciiGlyphPtr(
'1');
189 return asciiGlyphPtr(
'o');
191 return asciiGlyphPtr(
'>');
195 return asciiGlyphPtr(
'/');
197 return asciiGlyphPtr(
'?');
205 return asciiGlyphPtr(
'A');
207 return asciiGlyphPtr(
'C');
212 return asciiGlyphPtr(
'E');
217 return asciiGlyphPtr(
'I');
219 return asciiGlyphPtr(
'D');
221 return asciiGlyphPtr(
'N');
228 return asciiGlyphPtr(
'O');
230 return &multiplyGlyph();
235 return asciiGlyphPtr(
'U');
237 return asciiGlyphPtr(
'Y');
239 return asciiGlyphPtr(
'P');
241 return asciiGlyphPtr(
'B');
249 return asciiGlyphPtr(
'a');
251 return asciiGlyphPtr(
'c');
256 return asciiGlyphPtr(
'e');
261 return asciiGlyphPtr(
'i');
263 return asciiGlyphPtr(
'd');
265 return asciiGlyphPtr(
'n');
272 return asciiGlyphPtr(
'o');
274 return ÷Glyph();
279 return asciiGlyphPtr(
'u');
282 return asciiGlyphPtr(
'y');
284 return asciiGlyphPtr(
'p');
290 const Glyph* bulletGlyphPtr()
const {
291 static const Glyph glyph = {0b00000, 0b00100, 0b01110, 0b01110,
292 0b01110, 0b00100, 0b00000};
296 const Glyph& euroGlyph()
const {
297 static const Glyph glyph = {0b00110, 0b01001, 0b11100, 0b11110,
298 0b11100, 0b01001, 0b00110};
302 const Glyph& centGlyph()
const {
303 static const Glyph glyph = {0b00100, 0b01110, 0b10100, 0b10000,
304 0b10100, 0b01110, 0b00100};
308 const Glyph& sterlingGlyph()
const {
309 static const Glyph glyph = {0b00110, 0b01001, 0b01000, 0b11100,
310 0b01000, 0b11111, 0b01000};
314 const Glyph& yenGlyph()
const {
315 static const Glyph glyph = {0b10001, 0b01010, 0b11111, 0b00100,
316 0b11111, 0b00100, 0b00100};
320 const Glyph& sectionGlyph()
const {
321 static const Glyph glyph = {0b01110, 0b10000, 0b01100, 0b00010,
322 0b00110, 0b00001, 0b11110};
326 const Glyph& copyrightGlyph()
const {
327 static const Glyph glyph = {0b01110, 0b10001, 0b10111, 0b10101,
328 0b10111, 0b10001, 0b01110};
332 const Glyph& notGlyph()
const {
333 static const Glyph glyph = {0b00000, 0b00000, 0b11111, 0b00001,
334 0b00001, 0b00000, 0b00000};
338 const Glyph& degreeGlyph()
const {
339 static const Glyph glyph = {0b00110, 0b01001, 0b01001, 0b00110,
340 0b00000, 0b00000, 0b00000};
344 const Glyph& plusMinusGlyph()
const {
345 static const Glyph glyph = {0b00000, 0b00100, 0b00100, 0b11111,
346 0b00100, 0b11111, 0b00000};
350 const Glyph& microGlyph()
const {
351 static const Glyph glyph = {0b10001, 0b10001, 0b10001, 0b10011,
352 0b01101, 0b10000, 0b10000};
356 const Glyph& paragraphGlyph()
const {
357 static const Glyph glyph = {0b11110, 0b10110, 0b10110, 0b11110,
358 0b00100, 0b00100, 0b00100};
362 const Glyph& multiplyGlyph()
const {
363 static const Glyph glyph = {0b00000, 0b10001, 0b01010, 0b00100,
364 0b01010, 0b10001, 0b00000};
368 const Glyph& divideGlyph()
const {
369 static const Glyph glyph = {0b00000, 0b00100, 0b00000, 0b11111,
370 0b00000, 0b00100, 0b00000};
374 static const Glyph* glyphTable() {
375 static const Glyph kGlyphs[] = {
376 Glyph{0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000,
378 Glyph{0b00100, 0b00100, 0b00100, 0b00100, 0b00100, 0b00000,
380 Glyph{0b01010, 0b01010, 0b01010, 0b00000, 0b00000, 0b00000,
382 Glyph{0b01010, 0b01010, 0b11111, 0b01010, 0b11111, 0b01010,
384 Glyph{0b00100, 0b01111, 0b10100, 0b01110, 0b00101, 0b11110,
386 Glyph{0b11001, 0b11010, 0b00100, 0b01000, 0b10110, 0b00110,
388 Glyph{0b01100, 0b10010, 0b10100, 0b01000, 0b10101, 0b10010,
390 Glyph{0b00100, 0b00100, 0b00100, 0b00000, 0b00000, 0b00000,
392 Glyph{0b00010, 0b00100, 0b01000, 0b01000, 0b01000, 0b00100,
394 Glyph{0b01000, 0b00100, 0b00010, 0b00010, 0b00010, 0b00100,
396 Glyph{0b00000, 0b10101, 0b01110, 0b11111, 0b01110, 0b10101,
398 Glyph{0b00000, 0b00100, 0b00100, 0b11111, 0b00100, 0b00100,
400 Glyph{0b00000, 0b00000, 0b00000, 0b00000, 0b00100, 0b00100,
402 Glyph{0b00000, 0b00000, 0b00000, 0b11111, 0b00000, 0b00000,
404 Glyph{0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00100,
406 Glyph{0b00001, 0b00010, 0b00100, 0b01000, 0b10000, 0b00000,
408 Glyph{0b01110, 0b10001, 0b10011, 0b10101, 0b11001, 0b10001,
410 Glyph{0b00100, 0b01100, 0b00100, 0b00100, 0b00100, 0b00100,
412 Glyph{0b01110, 0b10001, 0b00001, 0b00010, 0b00100, 0b01000,
414 Glyph{0b11110, 0b00001, 0b00001, 0b01110, 0b00001, 0b00001,
416 Glyph{0b00010, 0b00110, 0b01010, 0b10010, 0b11111, 0b00010,
418 Glyph{0b11111, 0b10000, 0b11110, 0b00001, 0b00001, 0b10001,
420 Glyph{0b00110, 0b01000, 0b10000, 0b11110, 0b10001, 0b10001,
422 Glyph{0b11111, 0b00001, 0b00010, 0b00100, 0b01000, 0b01000,
424 Glyph{0b01110, 0b10001, 0b10001, 0b01110, 0b10001, 0b10001,
426 Glyph{0b01110, 0b10001, 0b10001, 0b01111, 0b00001, 0b00010,
428 Glyph{0b00000, 0b00100, 0b00100, 0b00000, 0b00100, 0b00100,
430 Glyph{0b00000, 0b00100, 0b00100, 0b00000, 0b00100, 0b00100,
432 Glyph{0b00010, 0b00100, 0b01000, 0b10000, 0b01000, 0b00100,
434 Glyph{0b00000, 0b00000, 0b11111, 0b00000, 0b11111, 0b00000,
436 Glyph{0b01000, 0b00100, 0b00010, 0b00001, 0b00010, 0b00100,
438 Glyph{0b01110, 0b10001, 0b00001, 0b00010, 0b00100, 0b00000,
440 Glyph{0b01110, 0b10001, 0b00001, 0b01101, 0b10101, 0b10101,
442 Glyph{0b01110, 0b10001, 0b10001, 0b11111, 0b10001, 0b10001,
444 Glyph{0b11110, 0b10001, 0b10001, 0b11110, 0b10001, 0b10001,
446 Glyph{0b01110, 0b10001, 0b10000, 0b10000, 0b10000, 0b10001,
448 Glyph{0b11100, 0b10010, 0b10001, 0b10001, 0b10001, 0b10010,
450 Glyph{0b11111, 0b10000, 0b10000, 0b11110, 0b10000, 0b10000,
452 Glyph{0b11111, 0b10000, 0b10000, 0b11110, 0b10000, 0b10000,
454 Glyph{0b01110, 0b10001, 0b10000, 0b10111, 0b10001, 0b10001,
456 Glyph{0b10001, 0b10001, 0b10001, 0b11111, 0b10001, 0b10001,
458 Glyph{0b01110, 0b00100, 0b00100, 0b00100, 0b00100, 0b00100,
460 Glyph{0b00001, 0b00001, 0b00001, 0b00001, 0b10001, 0b10001,
462 Glyph{0b10001, 0b10010, 0b10100, 0b11000, 0b10100, 0b10010,
464 Glyph{0b10000, 0b10000, 0b10000, 0b10000, 0b10000, 0b10000,
466 Glyph{0b10001, 0b11011, 0b10101, 0b10101, 0b10001, 0b10001,
468 Glyph{0b10001, 0b11001, 0b10101, 0b10011, 0b10001, 0b10001,
470 Glyph{0b01110, 0b10001, 0b10001, 0b10001, 0b10001, 0b10001,
472 Glyph{0b11110, 0b10001, 0b10001, 0b11110, 0b10000, 0b10000,
474 Glyph{0b01110, 0b10001, 0b10001, 0b10001, 0b10101, 0b10010,
476 Glyph{0b11110, 0b10001, 0b10001, 0b11110, 0b10100, 0b10010,
478 Glyph{0b01111, 0b10000, 0b10000, 0b01110, 0b00001, 0b00001,
480 Glyph{0b11111, 0b00100, 0b00100, 0b00100, 0b00100, 0b00100,
482 Glyph{0b10001, 0b10001, 0b10001, 0b10001, 0b10001, 0b10001,
484 Glyph{0b10001, 0b10001, 0b10001, 0b10001, 0b10001, 0b01010,
486 Glyph{0b10001, 0b10001, 0b10001, 0b10101, 0b10101, 0b10101,
488 Glyph{0b10001, 0b10001, 0b01010, 0b00100, 0b01010, 0b10001,
490 Glyph{0b10001, 0b10001, 0b01010, 0b00100, 0b00100, 0b00100,
492 Glyph{0b11111, 0b00001, 0b00010, 0b00100, 0b01000, 0b10000,
494 Glyph{0b01110, 0b01000, 0b01000, 0b01000, 0b01000, 0b01000,
496 Glyph{0b10000, 0b01000, 0b00100, 0b00010, 0b00001, 0b00000,
498 Glyph{0b01110, 0b00010, 0b00010, 0b00010, 0b00010, 0b00010,
500 Glyph{0b00100, 0b01010, 0b10001, 0b00000, 0b00000, 0b00000,
502 Glyph{0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000,
504 Glyph{0b01000, 0b00100, 0b00010, 0b00000, 0b00000, 0b00000,
506 Glyph{0b00000, 0b00000, 0b01110, 0b00001, 0b01111, 0b10001,
508 Glyph{0b10000, 0b10000, 0b10110, 0b11001, 0b10001, 0b10001,
510 Glyph{0b00000, 0b00000, 0b01110, 0b10000, 0b10000, 0b10001,
512 Glyph{0b00001, 0b00001, 0b01101, 0b10011, 0b10001, 0b10001,
514 Glyph{0b00000, 0b00000, 0b01110, 0b10001, 0b11111, 0b10000,
516 Glyph{0b00110, 0b01001, 0b01000, 0b11100, 0b01000, 0b01000,
518 Glyph{0b00000, 0b00000, 0b01111, 0b10001, 0b10001, 0b01111,
520 Glyph{0b10000, 0b10000, 0b10110, 0b11001, 0b10001, 0b10001,
522 Glyph{0b00100, 0b00000, 0b01100, 0b00100, 0b00100, 0b00100,
524 Glyph{0b00010, 0b00000, 0b00110, 0b00010, 0b00010, 0b10010,
526 Glyph{0b10000, 0b10000, 0b10010, 0b10100, 0b11000, 0b10100,
528 Glyph{0b01100, 0b00100, 0b00100, 0b00100, 0b00100, 0b00100,
530 Glyph{0b00000, 0b00000, 0b11010, 0b10101, 0b10101, 0b10101,
532 Glyph{0b00000, 0b00000, 0b10110, 0b11001, 0b10001, 0b10001,
534 Glyph{0b00000, 0b00000, 0b01110, 0b10001, 0b10001, 0b10001,
536 Glyph{0b00000, 0b00000, 0b11110, 0b10001, 0b11110, 0b10000,
538 Glyph{0b00000, 0b00000, 0b01101, 0b10001, 0b01111, 0b00001,
540 Glyph{0b00000, 0b00000, 0b10110, 0b11001, 0b10000, 0b10000,
542 Glyph{0b00000, 0b00000, 0b01111, 0b10000, 0b01110, 0b00001,
544 Glyph{0b01000, 0b01000, 0b11100, 0b01000, 0b01000, 0b01001,
546 Glyph{0b00000, 0b00000, 0b10001, 0b10001, 0b10001, 0b10011,
548 Glyph{0b00000, 0b00000, 0b10001, 0b10001, 0b10001, 0b01010,
550 Glyph{0b00000, 0b00000, 0b10001, 0b10001, 0b10101, 0b10101,
552 Glyph{0b00000, 0b00000, 0b10001, 0b01010, 0b00100, 0b01010,
554 Glyph{0b00000, 0b00000, 0b10001, 0b10001, 0b01111, 0b00001,
556 Glyph{0b00000, 0b00000, 0b11111, 0b00010, 0b00100, 0b01000,
558 Glyph{0b00010, 0b00100, 0b00100, 0b01000, 0b00100, 0b00100,
560 Glyph{0b00100, 0b00100, 0b00100, 0b00100, 0b00100, 0b00100,
562 Glyph{0b01000, 0b00100, 0b00100, 0b00010, 0b00100, 0b00100,
564 Glyph{0b00000, 0b00000, 0b01001, 0b10110, 0b00000, 0b00000,
Fixed-size bitmap font backed by a caller-supplied glyph table.
Definition: BitmapFont.h:30
Fixed-size 5x7 bitmap font with ASCII and extended character support.
Definition: Font5x7.h:23
static constexpr char kLastChar
Last directly stored ASCII character.
Definition: Font5x7.h:33
static constexpr char kFirstChar
First directly stored ASCII character.
Definition: Font5x7.h:31
const Glyph & glyph(CodePoint codePoint) const override
Definition: Font5x7.h:44
Font5x7()
Creates a Font5x7 instance.
Definition: Font5x7.h:36
RGB color stored in 16-bit RGB565 format, byte-swapped from the conventional bit layout.
Definition: RGB565.h:24
Definition: DSIBusESP32.h:19