Fonts

lbutils.graphics.fonts

Fonts for the LED and OLED displays; especially the those using the 'pmod' packages. These fonts are based on open-source font files, and converted with the fontconvert utility written by Daniel Perron.S.

Most of the work of this library consists of rebuilding the font representation as described below. This reconstruction is undertaken by the BaseFont class, and abstract class which must be sub-classed for a specific font. Currently the fonts (and subclasses) exposed in this library are

  • Font06. 6x6 pixel sans-serif font.
  • Font08. 8x8 pixel sans-serif font.
  • Org01. A tiny, stylized font with all characters within a 6 pixel height. Created by fontconvert, from the Org_v01 by Orgdot.

All fonts are provided in a single package, lbutils.graphics.fonts, with most of the functionality implemented by the the BaseFont class. Together the BaseFont class and the classes above providing specific fonts are organised as follows

Graphics Package Diagram

Rebuilding the Fonts

Rebuilding the fonts requires the fontconvert utility to be built in C with [the FreeType library] (https://freetype.org). Once built the fonts can be converted using fontconvert as

./fontconvert ~/Library/Fonts/FreeSans.ttf 18 > FreeSans18pt7b.py

Currently the fontconvert utility only extracts the printable 7-bit ASCII characters of a font: for the exact character set extracted see the resulting Python file.

Tested Implementations

  • Raspberry Pi Pico W (MicroPython 3.4)
  • CPython (3.10)

lbutils.graphics.fonts.BaseFont

A Base Class which implements the access methods required to use the individual font representations of the sub-classes. Those sub-classes provide only the bitmap representation of the font: the reconstruction of that bitmap is handled here by BaseFont.

Methods

  • get_bit(). Returns the state ('0' or '1') of the bit specified by the current cursor position within the current glyph bitmap.

  • get_next(). Return the state of the current bit within the bitmap being displayed, and then advance the internal cursor to the next position: ready for the next call.

  • set_position(). Set the internal state to draw the glyph of the character in the next natural position.

Source code in lbutils/graphics/fonts/base_font.py
 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
class BaseFont:
    """A Base Class which implements the access methods required to use the
    individual font representations of the sub-classes. Those sub-classes
    provide only the _bitmap_ representation of the font: the reconstruction of
    that bitmap is handled here by `BaseFont`.

    Methods
    -------

    * `get_bit()`. Returns the state ('0' or '1') of the bit specified by
    the current cursor `position` within the current glyph bitmap.

    * `get_next()`. Return the state of the current bit within the bitmap
    being displayed, and then advance the internal cursor to
    the next position: ready for the next call.

    * `set_position()`. Set the internal state to draw the glyph of the character
    in the next natural position.
    """

    def __init__(self, bitmap: bytes, index: dict[str, int], glyph: list) -> None:
        """Take the byte array of `bitmap`s with the `index` of font characters
        and use these together with the `glyph` list to reconstruct the required
        font. This method is typically called by a sub-class in the constructor
        of the sub-class as in.

        ````python
        def __init__(self):
            super().__init__(self.bitmap, self.index, self.glyph)
        ````

        Parameters
        ----------

        bitmap: list[bytes]
            Calculated bit representations of glyph fragments. Used in
            reconstructing the specified glyphs.
        index: list
            Cross-references the UTF-8 characters to the list of glyphs specified
            in `glyph`. This provides the main mapping for character values to
            glyphs.
        glyph: list
            Specifies the bitmap sequence used to reconstruct a specific glyph.
            This provides the main definition of the core glphys from the
            original font definition.
        """

        self.bitmap = bitmap
        self.index = index
        self.glyph = glyph
        self.current_char = 0
        self.current_glyph = glyph[0]

    def set_position(self, utf8_char: str) -> None:
        """Set the internal state to draw the glyph of the character given in
        `utf8_char`. This internal state is not exposed to the calling method or
        function: but will be used in subsequent calls to
        [`get_bit`][lbutils.graphics.fonts.base_font.BaseFont.get_bit] or
        [`get_next`][lbutils.graphics.fonts.base_font.BaseFont.get_next].

        Parameters
        ----------

        utf8_char: str
            A single character string holding the character that
            will be drawn next from the internal glyph representation.
        """

        # Calculate the index into the glyph array, based on
        # the specified `utf_8` string. If the string cannot
        # be found, use the space (' ') string instead.
        #
        # Once found, set the `self.current_char` to the
        # required character value
        if utf8_char in self.index:
            self.current_char = self.index[utf8_char]
        else:
            self.current_char = self.index[" "]

        # Get the array of bitmaps corresponding to the
        # required character in `self.current_char`. Assign
        # this array to `self.current_glphy` for future use
        self.current_glyph = self.glyph[self.current_char]

        # Calculated the position of the next glyph, based
        # on the required character and the current glyph
        # bitmap array. Store in `self.position` for later
        # use
        self.position = self.current_glyph[0] * 8

    def get_bit(self, position: int) -> int:
        """Return the state ('0' or '1') of the bit specified by the current
        cursor `position` within the current glyph bitmap.

        Parameters
        ----------

        position: int
            The position within the glyph bitmap to test for state


        Returns
        -------

        int
            Either '`0`' or '`1`' depending on the bitmap value
            of the current cursor position within the glyph.
        """

        c_offset = position // 8
        c_bit = 128 >> (position % 8)
        c_flag = (self.bitmap[c_offset] & c_bit) != 0

        return c_flag

    def get_next(self) -> int:
        """Return the state of the current bit within the bitmap being
        displayed, and then advance the internal cursor to the next position:
        ready for the next call.

        Returns
        -------

        int
            Either '`0`' or '`1`' depending on the bitmap value
            of the current cursor position within the glyph.
        """

        flag = self.get_bit(self.position)
        self.position = self.position + 1

        return flag

__init__

__init__(
    bitmap: bytes, index: dict[str, int], glyph: list
) -> None

Take the byte array of bitmaps with the index of font characters and use these together with the glyph list to reconstruct the required font. This method is typically called by a sub-class in the constructor of the sub-class as in.

def __init__(self):
    super().__init__(self.bitmap, self.index, self.glyph)

Parameters:

  • bitmap (bytes) –

    Calculated bit representations of glyph fragments. Used in reconstructing the specified glyphs.

  • index (dict[str, int]) –

    Cross-references the UTF-8 characters to the list of glyphs specified in glyph. This provides the main mapping for character values to glyphs.

  • glyph (list) –

    Specifies the bitmap sequence used to reconstruct a specific glyph. This provides the main definition of the core glphys from the original font definition.

Source code in lbutils/graphics/fonts/base_font.py
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
def __init__(self, bitmap: bytes, index: dict[str, int], glyph: list) -> None:
    """Take the byte array of `bitmap`s with the `index` of font characters
    and use these together with the `glyph` list to reconstruct the required
    font. This method is typically called by a sub-class in the constructor
    of the sub-class as in.

    ````python
    def __init__(self):
        super().__init__(self.bitmap, self.index, self.glyph)
    ````

    Parameters
    ----------

    bitmap: list[bytes]
        Calculated bit representations of glyph fragments. Used in
        reconstructing the specified glyphs.
    index: list
        Cross-references the UTF-8 characters to the list of glyphs specified
        in `glyph`. This provides the main mapping for character values to
        glyphs.
    glyph: list
        Specifies the bitmap sequence used to reconstruct a specific glyph.
        This provides the main definition of the core glphys from the
        original font definition.
    """

    self.bitmap = bitmap
    self.index = index
    self.glyph = glyph
    self.current_char = 0
    self.current_glyph = glyph[0]

get_bit

get_bit(position: int) -> int

Return the state ('0' or '1') of the bit specified by the current cursor position within the current glyph bitmap.

Parameters:

  • position (int) –

    The position within the glyph bitmap to test for state

Returns:

  • int

    Either '0' or '1' depending on the bitmap value of the current cursor position within the glyph.

Source code in lbutils/graphics/fonts/base_font.py
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
def get_bit(self, position: int) -> int:
    """Return the state ('0' or '1') of the bit specified by the current
    cursor `position` within the current glyph bitmap.

    Parameters
    ----------

    position: int
        The position within the glyph bitmap to test for state


    Returns
    -------

    int
        Either '`0`' or '`1`' depending on the bitmap value
        of the current cursor position within the glyph.
    """

    c_offset = position // 8
    c_bit = 128 >> (position % 8)
    c_flag = (self.bitmap[c_offset] & c_bit) != 0

    return c_flag

get_next

get_next() -> int

Return the state of the current bit within the bitmap being displayed, and then advance the internal cursor to the next position: ready for the next call.

Returns:

  • int

    Either '0' or '1' depending on the bitmap value of the current cursor position within the glyph.

Source code in lbutils/graphics/fonts/base_font.py
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
def get_next(self) -> int:
    """Return the state of the current bit within the bitmap being
    displayed, and then advance the internal cursor to the next position:
    ready for the next call.

    Returns
    -------

    int
        Either '`0`' or '`1`' depending on the bitmap value
        of the current cursor position within the glyph.
    """

    flag = self.get_bit(self.position)
    self.position = self.position + 1

    return flag

set_position

set_position(utf8_char: str) -> None

Set the internal state to draw the glyph of the character given in utf8_char. This internal state is not exposed to the calling method or function: but will be used in subsequent calls to get_bit or get_next.

Parameters:

  • utf8_char (str) –

    A single character string holding the character that will be drawn next from the internal glyph representation.

Source code in lbutils/graphics/fonts/base_font.py
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
def set_position(self, utf8_char: str) -> None:
    """Set the internal state to draw the glyph of the character given in
    `utf8_char`. This internal state is not exposed to the calling method or
    function: but will be used in subsequent calls to
    [`get_bit`][lbutils.graphics.fonts.base_font.BaseFont.get_bit] or
    [`get_next`][lbutils.graphics.fonts.base_font.BaseFont.get_next].

    Parameters
    ----------

    utf8_char: str
        A single character string holding the character that
        will be drawn next from the internal glyph representation.
    """

    # Calculate the index into the glyph array, based on
    # the specified `utf_8` string. If the string cannot
    # be found, use the space (' ') string instead.
    #
    # Once found, set the `self.current_char` to the
    # required character value
    if utf8_char in self.index:
        self.current_char = self.index[utf8_char]
    else:
        self.current_char = self.index[" "]

    # Get the array of bitmaps corresponding to the
    # required character in `self.current_char`. Assign
    # this array to `self.current_glphy` for future use
    self.current_glyph = self.glyph[self.current_char]

    # Calculated the position of the next glyph, based
    # on the required character and the current glyph
    # bitmap array. Store in `self.position` for later
    # use
    self.position = self.current_glyph[0] * 8

lbutils.graphics.fonts.font06

Font06

Bases: BaseFont

6x6 pixel sans-serif font, created by fontconvert.

Source code in lbutils/graphics/fonts/font06.py
 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
class Font06(BaseFont):
    """6x6 pixel sans-serif font, created by
    [`fontconvert`](https://github.com/danjperron/ssd1331_micropython.git)."""

    def __init__(self) -> None:
        super().__init__(self.bitmap, self.index, self.glyph)

    bitmap = bytes(
        [
            0x00,
            0xD0,
            0xB4,
            0x6F,
            0xFA,
            0x5F,
            0x3E,
            0x80,
            0xCE,
            0x73,
            0x64,
            0xBF,
            0xC0,
            0x70,
            0x70,
            0xFC,
            0x5D,
            0x00,
            0xC0,
            0xC0,
            0x80,
            0x29,
            0x28,
            0x6D,
            0x96,
            0xC9,
            0x70,
            0xF0,
            0xD9,
            0xE0,
            0xF6,
            0x1F,
            0x26,
            0xF2,
            0xFF,
            0x1F,
            0x78,
            0xFF,
            0xF2,
            0x24,
            0xF6,
            0x9F,
            0xFF,
            0x1E,
            0xA0,
            0xB0,
            0x39,
            0x80,
            0xE3,
            0x80,
            0x8F,
            0x00,
            0xE1,
            0x69,
            0xB8,
            0x60,
            0x66,
            0x69,
            0xFE,
            0x9F,
            0x78,
            0x87,
            0xE9,
            0x9E,
            0xFF,
            0x8F,
            0xFF,
            0x88,
            0x7B,
            0x97,
            0x9F,
            0x99,
            0xE9,
            0x70,
            0xD7,
            0xAC,
            0xCA,
            0x88,
            0x8F,
            0x9F,
            0x99,
            0xDD,
            0xBB,
            0xF9,
            0x9F,
            0xF9,
            0xF8,
            0xF9,
            0x9E,
            0x10,
            0xF9,
            0xE9,
            0xFE,
            0x1F,
            0xE9,
            0x20,
            0x99,
            0x9F,
            0x96,
            0x66,
            0x9F,
            0xFA,
            0xF6,
            0x6F,
            0xA9,
            0x20,
            0xF2,
            0x6F,
            0xEA,
            0xC0,
            0x89,
            0x22,
            0xD5,
            0xC0,
            0x54,
            0xF0,
            0x80,
            0x79,
            0x70,
            0x88,
            0xE9,
            0xE0,
            0xF3,
            0x80,
            0x11,
            0xFD,
            0xF0,
            0xFF,
            0xF0,
            0x6B,
            0xA4,
            0xF9,
            0xFF,
            0x88,
            0xF9,
            0x90,
            0x43,
            0x2E,
            0x4D,
            0x70,
            0x84,
            0x2D,
            0x8A,
            0x00,
            0xC9,
            0x26,
            0xFD,
            0x6A,
            0x00,
            0xF9,
            0x90,
            0xF9,
            0xF0,
            0xF9,
            0xF8,
            0xF9,
            0xF1,
            0xE8,
            0xF7,
            0xF0,
            0x5D,
            0x30,
            0x99,
            0xF0,
            0x96,
            0x60,
            0xAD,
            0x54,
            0x00,
            0xE4,
            0xE0,
            0xB6,
            0x4C,
            0xFC,
            0xF0,
            0x6A,
            0x24,
            0xC0,
            0xFC,
            0xC8,
            0xA5,
            0x80,
            0x3E,
            0x00,
        ],
    )

    index = {
        " ": 0,
        "!": 1,
        '"': 2,
        "#": 3,
        "$": 4,
        "%": 5,
        "&": 6,
        "'": 7,
        "(": 8,
        ")": 9,
        "*": 10,
        "+": 11,
        ",": 12,
        "-": 13,
        ".": 14,
        "/": 15,
        "0": 16,
        "1": 17,
        "2": 18,
        "3": 19,
        "4": 20,
        "5": 21,
        "6": 22,
        "7": 23,
        "8": 24,
        "9": 25,
        ":": 26,
        ";": 27,
        "<": 28,
        "=": 29,
        ">": 30,
        "?": 31,
        "@": 32,
        "A": 33,
        "B": 34,
        "C": 35,
        "D": 36,
        "E": 37,
        "F": 38,
        "G": 39,
        "H": 40,
        "I": 41,
        "J": 42,
        "K": 43,
        "L": 44,
        "M": 45,
        "N": 46,
        "O": 47,
        "P": 48,
        "Q": 49,
        "R": 50,
        "S": 51,
        "T": 52,
        "U": 53,
        "V": 54,
        "W": 55,
        "X": 56,
        "Y": 57,
        "Z": 58,
        "[": 59,
        "\\": 60,
        "]": 61,
        "^": 62,
        "_": 63,
        "`": 64,
        "a": 65,
        "b": 66,
        "c": 67,
        "d": 68,
        "e": 69,
        "f": 70,
        "g": 71,
        "h": 72,
        "i": 73,
        "j": 74,
        "k": 75,
        "l": 76,
        "m": 77,
        "n": 78,
        "o": 79,
        "p": 80,
        "q": 81,
        "r": 82,
        "s": 83,
        "t": 84,
        "u": 85,
        "v": 86,
        "w": 87,
        "x": 88,
        "y": 89,
        "z": 90,
        "{": 91,
        "|": 92,
        "}": 93,
        "~": 94,
    }

    glyph = [
        [0, 1, 1, 5, 0, -1],  # 0x20 ' '
        [1, 1, 4, 5, 2, -4],  # 0x21 '!'
        [2, 3, 2, 5, 1, -4],  # 0x22 '"'
        [3, 4, 4, 5, 0, -4],  # 0x23 '#'
        [5, 3, 6, 5, 1, -5],  # 0x24 '$'
        [8, 4, 4, 5, 0, -4],  # 0x25 '%'
        [10, 4, 4, 5, 1, -4],  # 0x26 '&'
        [12, 1, 2, 5, 2, -4],  # 0x27 '''
        [13, 1, 5, 5, 1, -5],  # 0x28 '('
        [14, 1, 5, 5, 2, -5],  # 0x29 ')'
        [15, 3, 2, 5, 1, -4],  # 0x2A '*'
        [16, 3, 3, 5, 1, -4],  # 0x2B '+'
        [18, 1, 2, 5, 1, -1],  # 0x2C ','
        [19, 2, 1, 5, 1, -2],  # 0x2D '-'
        [20, 1, 1, 5, 1, -1],  # 0x2E '.'
        [21, 3, 5, 5, 0, -4],  # 0x2F '/'
        [23, 4, 4, 5, 1, -4],  # 0x30 '0'
        [25, 3, 4, 5, 1, -4],  # 0x31 '1'
        [27, 5, 4, 5, 1, -4],  # 0x32 '2'
        [30, 4, 4, 5, 1, -4],  # 0x33 '3'
        [32, 4, 4, 5, 1, -4],  # 0x34 '4'
        [34, 4, 4, 5, 1, -4],  # 0x35 '5'
        [36, 4, 4, 5, 1, -4],  # 0x36 '6'
        [38, 4, 4, 5, 1, -4],  # 0x37 '7'
        [40, 4, 4, 5, 1, -4],  # 0x38 '8'
        [42, 4, 4, 5, 1, -4],  # 0x39 '9'
        [44, 1, 3, 5, 1, -3],  # 0x3A ':'
        [45, 1, 4, 5, 1, -3],  # 0x3B ';'
        [46, 3, 3, 5, 1, -3],  # 0x3C '<'
        [48, 3, 3, 5, 0, -4],  # 0x3D '='
        [50, 3, 3, 5, 1, -3],  # 0x3E '>'
        [52, 2, 4, 5, 0, -4],  # 0x3F '?'
        [53, 4, 5, 5, 1, -4],  # 0x40 '@'
        [56, 4, 4, 5, 1, -4],  # 0x41 'A'
        [58, 4, 4, 5, 1, -4],  # 0x42 'B'
        [60, 4, 4, 5, 1, -4],  # 0x43 'C'
        [62, 4, 4, 5, 1, -4],  # 0x44 'D'
        [64, 4, 4, 5, 1, -4],  # 0x45 'E'
        [66, 4, 4, 5, 1, -4],  # 0x46 'F'
        [68, 4, 4, 5, 1, -4],  # 0x47 'G'
        [70, 4, 4, 5, 1, -4],  # 0x48 'H'
        [72, 3, 4, 5, 1, -4],  # 0x49 'I'
        [74, 2, 4, 5, 1, -4],  # 0x4A 'J'
        [75, 4, 4, 5, 1, -4],  # 0x4B 'K'
        [77, 4, 4, 5, 1, -4],  # 0x4C 'L'
        [79, 4, 4, 5, 1, -4],  # 0x4D 'M'
        [81, 4, 4, 5, 1, -4],  # 0x4E 'N'
        [83, 4, 4, 5, 1, -4],  # 0x4F 'O'
        [85, 4, 4, 5, 1, -4],  # 0x50 'P'
        [87, 4, 5, 5, 1, -4],  # 0x51 'Q'
        [90, 4, 4, 5, 1, -4],  # 0x52 'R'
        [92, 4, 4, 5, 1, -4],  # 0x53 'S'
        [94, 3, 4, 5, 1, -4],  # 0x54 'T'
        [96, 4, 4, 5, 1, -4],  # 0x55 'U'
        [98, 4, 4, 5, 1, -4],  # 0x56 'V'
        [100, 4, 4, 5, 0, -4],  # 0x57 'W'
        [102, 4, 4, 5, 1, -4],  # 0x58 'X'
        [104, 3, 4, 5, 1, -4],  # 0x59 'Y'
        [106, 4, 4, 5, 1, -4],  # 0x5A 'Z'
        [108, 2, 5, 5, 1, -5],  # 0x5B '['
        [110, 3, 5, 5, 0, -4],  # 0x5C '\'
        [112, 2, 5, 5, 1, -5],  # 0x5D ']'
        [114, 3, 2, 5, 0, -4],  # 0x5E '^'
        [115, 4, 1, 5, 0, 0],  # 0x5F '_'
        [116, 1, 1, 5, 1, -5],  # 0x60 '`'
        [117, 4, 3, 5, 0, -3],  # 0x61 'a'
        [119, 4, 5, 5, 0, -5],  # 0x62 'b'
        [122, 3, 3, 5, 0, -3],  # 0x63 'c'
        [124, 4, 5, 5, 0, -5],  # 0x64 'd'
        [127, 4, 3, 5, 0, -3],  # 0x65 'e'
        [129, 3, 5, 5, 0, -5],  # 0x66 'f'
        [131, 4, 4, 5, 0, -3],  # 0x67 'g'
        [133, 4, 5, 5, 0, -5],  # 0x68 'h'
        [136, 3, 5, 5, 1, -5],  # 0x69 'i'
        [138, 2, 6, 5, 1, -5],  # 0x6A 'j'
        [140, 5, 5, 5, 0, -5],  # 0x6B 'k'
        [144, 3, 5, 5, 0, -5],  # 0x6C 'l'
        [146, 5, 3, 5, 0, -3],  # 0x6D 'm'
        [149, 4, 3, 5, 0, -3],  # 0x6E 'n'
        [151, 4, 3, 5, 0, -3],  # 0x6F 'o'
        [153, 4, 4, 5, 0, -3],  # 0x70 'p'
        [155, 4, 4, 5, 0, -3],  # 0x71 'q'
        [157, 2, 3, 5, 1, -3],  # 0x72 'r'
        [158, 4, 3, 5, 0, -3],  # 0x73 's'
        [160, 3, 4, 5, 0, -4],  # 0x74 't'
        [162, 4, 3, 5, 0, -3],  # 0x75 'u'
        [164, 4, 3, 5, 0, -3],  # 0x76 'v'
        [166, 5, 3, 5, 0, -3],  # 0x77 'w'
        [169, 4, 3, 5, 0, -3],  # 0x78 'x'
        [171, 4, 4, 5, 0, -3],  # 0x79 'y'
        [173, 4, 3, 5, 0, -3],  # 0x7A 'z'
        [175, 3, 6, 5, 1, -5],  # 0x7B '{'
        [178, 1, 6, 5, 2, -5],  # 0x7C '|'
        [179, 3, 6, 5, 1, -5],  # 0x7D '}'
        [182, 3, 3, 4, 0, -4],
    ]  # 0x7E '~'

lbutils.graphics.fonts.font08

Font08

Bases: BaseFont

8x8 pixel sans-serif font, created by fontconvert.

Source code in lbutils/graphics/fonts/font08.py
 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
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
class Font08(BaseFont):
    """8x8 pixel sans-serif font, created by
    [`fontconvert`](https://github.com/danjperron/ssd1331_micropython.git)."""

    def __init__(self) -> None:
        super().__init__(self.bitmap, self.index, self.glyph)

    bitmap = bytes(
        [
            0xF4,
            0xF4,
            0x00,
            0xB4,
            0x00,
            0x4B,
            0xF4,
            0x92,
            0x49,
            0x2F,
            0xD2,
            0x09,
            0xE9,
            0x64,
            0x78,
            0x9A,
            0x5E,
            0x40,
            0x00,
            0x46,
            0x94,
            0x84,
            0x21,
            0x29,
            0x62,
            0x6B,
            0xA7,
            0xC0,
            0xC0,
            0x6A,
            0xA4,
            0x00,
            0x95,
            0x58,
            0x00,
            0xAB,
            0x88,
            0xEA,
            0x80,
            0x21,
            0x3E,
            0x42,
            0x00,
            0xD8,
            0x00,
            0xE0,
            0x80,
            0x00,
            0x10,
            0x84,
            0x21,
            0x08,
            0x00,
            0x69,
            0x99,
            0x99,
            0x60,
            0x59,
            0x24,
            0xB8,
            0x00,
            0x69,
            0x12,
            0x48,
            0xF0,
            0x69,
            0x16,
            0x19,
            0x60,
            0x11,
            0x94,
            0xA9,
            0x7C,
            0x40,
            0xF8,
            0x86,
            0x19,
            0x60,
            0x69,
            0x8E,
            0x99,
            0x60,
            0xF1,
            0x22,
            0x44,
            0x80,
            0x69,
            0x96,
            0x99,
            0x60,
            0x69,
            0x97,
            0x19,
            0x60,
            0x98,
            0x13,
            0x60,
            0x24,
            0x84,
            0x20,
            0x0F,
            0x0F,
            0x00,
            0x84,
            0x24,
            0x80,
            0x69,
            0x12,
            0x44,
            0x04,
            0x39,
            0x19,
            0x6B,
            0x9D,
            0x03,
            0x80,
            0x69,
            0x99,
            0xF9,
            0x90,
            0xE9,
            0x9E,
            0x99,
            0xE0,
            0x69,
            0x88,
            0x89,
            0x60,
            0xE9,
            0x99,
            0x99,
            0xE0,
            0xF8,
            0x8E,
            0x88,
            0xF0,
            0xF8,
            0x8E,
            0x88,
            0x80,
            0x69,
            0x8B,
            0x99,
            0x70,
            0x99,
            0x9F,
            0x99,
            0x90,
            0x49,
            0x24,
            0x90,
            0x00,
            0x24,
            0x93,
            0x50,
            0x00,
            0x99,
            0xAC,
            0xA9,
            0x90,
            0x88,
            0x88,
            0x88,
            0xF0,
            0xDD,
            0x6B,
            0x58,
            0xC6,
            0x20,
            0x8E,
            0x6B,
            0x5A,
            0xCE,
            0x20,
            0x74,
            0x63,
            0x18,
            0xC5,
            0xC0,
            0xE9,
            0x9E,
            0x88,
            0x80,
            0x69,
            0x99,
            0x9B,
            0x60,
            0xE9,
            0x9E,
            0xA9,
            0x90,
            0x69,
            0x86,
            0x19,
            0x60,
            0xF9,
            0x08,
            0x42,
            0x10,
            0x80,
            0x99,
            0x99,
            0x99,
            0x60,
            0x8C,
            0x63,
            0x18,
            0xA8,
            0x80,
            0x8C,
            0x6B,
            0x5A,
            0xD5,
            0x40,
            0x8C,
            0x54,
            0x45,
            0x46,
            0x20,
            0x8C,
            0x54,
            0x42,
            0x10,
            0x80,
            0xF8,
            0x44,
            0x44,
            0x43,
            0xE0,
            0xEA,
            0xAC,
            0x00,
            0x02,
            0x04,
            0x08,
            0x10,
            0x20,
            0x40,
            0xD5,
            0x5C,
            0x00,
            0x22,
            0xA2,
            0x00,
            0xFC,
            0x00,
            0x90,
            0x79,
            0x97,
            0x88,
            0x8E,
            0x99,
            0xE0,
            0xF2,
            0x70,
            0x11,
            0x17,
            0x99,
            0x70,
            0x06,
            0xF8,
            0x70,
            0x65,
            0x4E,
            0x44,
            0x40,
            0x79,
            0x97,
            0x1F,
            0x88,
            0x8E,
            0x99,
            0x90,
            0x08,
            0x24,
            0x90,
            0x00,
            0x08,
            0x24,
            0x92,
            0xC0,
            0x88,
            0x9A,
            0xCA,
            0x90,
            0x44,
            0x44,
            0x44,
            0x60,
            0xD5,
            0x6B,
            0x10,
            0xE9,
            0x99,
            0x79,
            0x96,
            0xE9,
            0x9E,
            0x88,
            0x79,
            0x97,
            0x11,
            0xF2,
            0x40,
            0x0F,
            0xE1,
            0xF0,
            0x44,
            0xE4,
            0x46,
            0x99,
            0x97,
            0xAA,
            0xA4,
            0x8D,
            0x6A,
            0xA0,
            0x96,
            0x69,
            0x99,
            0x97,
            0x1F,
            0xF2,
            0x4F,
            0x29,
            0x64,
            0x88,
            0x00,
            0xFF,
            0x89,
            0x34,
            0xA0,
            0x00,
            0x1F,
            0x80,
        ],
    )

    index = {
        " ": 0,
        "!": 1,
        '"': 2,
        "#": 3,
        "$": 4,
        "%": 5,
        "&": 6,
        "'": 7,
        "(": 8,
        ")": 9,
        "*": 10,
        "+": 11,
        ",": 12,
        "-": 13,
        ".": 14,
        "/": 15,
        "0": 16,
        "1": 17,
        "2": 18,
        "3": 19,
        "4": 20,
        "5": 21,
        "6": 22,
        "7": 23,
        "8": 24,
        "9": 25,
        ":": 26,
        ";": 27,
        "<": 28,
        "=": 29,
        ">": 30,
        "?": 31,
        "@": 32,
        "A": 33,
        "B": 34,
        "C": 35,
        "D": 36,
        "E": 37,
        "F": 38,
        "G": 39,
        "H": 40,
        "I": 41,
        "J": 42,
        "K": 43,
        "L": 44,
        "M": 45,
        "N": 46,
        "O": 47,
        "P": 48,
        "Q": 49,
        "R": 50,
        "S": 51,
        "T": 52,
        "U": 53,
        "V": 54,
        "W": 55,
        "X": 56,
        "Y": 57,
        "Z": 58,
        "[": 59,
        "\\": 60,
        "]": 61,
        "^": 62,
        "_": 63,
        "`": 64,
        "a": 65,
        "b": 66,
        "c": 67,
        "d": 68,
        "e": 69,
        "f": 70,
        "g": 71,
        "h": 72,
        "i": 73,
        "j": 74,
        "k": 75,
        "l": 76,
        "m": 77,
        "n": 78,
        "o": 79,
        "p": 80,
        "q": 81,
        "r": 82,
        "s": 83,
        "t": 84,
        "u": 85,
        "v": 86,
        "w": 87,
        "x": 88,
        "y": 89,
        "z": 90,
        "{": 91,
        "|": 92,
        "}": 93,
        "~": 94,
    }

    glyph = [
        [0, 1, 1, 6, 0, -1],  # 0x20 ' '
        [1, 1, 6, 6, 2, -6],  # 0x21 '!'
        [3, 3, 2, 6, 1, -6],  # 0x22 '"'
        [5, 6, 8, 6, 0, -7],  # 0x23 '#'
        [11, 6, 9, 6, 0, -7],  # 0x24 '$'
        [19, 6, 8, 6, 0, -7],  # 0x25 '%'
        [25, 4, 6, 6, 1, -6],  # 0x26 '&'
        [28, 1, 2, 6, 2, -6],  # 0x27 '''
        [29, 2, 7, 6, 2, -7],  # 0x28 '('
        [32, 2, 7, 6, 1, -7],  # 0x29 ')'
        [35, 5, 5, 6, 0, -4],  # 0x2A '*'
        [39, 5, 5, 6, 0, -4],  # 0x2B '+'
        [43, 2, 3, 6, 2, -1],  # 0x2C ', '
        [45, 3, 1, 6, 1, -2],  # 0x2D '-'
        [46, 1, 1, 6, 2, -1],  # 0x2E '.'
        [47, 6, 7, 6, 0, -7],  # 0x2F '/'
        [53, 4, 7, 6, 1, -6],  # 0x30 '0'
        [57, 3, 7, 6, 1, -6],  # 0x31 '1'
        [61, 4, 7, 6, 1, -6],  # 0x32 '2'
        [65, 4, 7, 6, 1, -6],  # 0x33 '3'
        [69, 5, 7, 6, 1, -6],  # 0x34 '4'
        [74, 4, 7, 6, 1, -6],  # 0x35 '5'
        [78, 4, 7, 6, 1, -6],  # 0x36 '6'
        [82, 4, 7, 6, 1, -6],  # 0x37 '7'
        [86, 4, 7, 6, 1, -6],  # 0x38 '8'
        [90, 4, 7, 6, 1, -6],  # 0x39 '9'
        [94, 1, 4, 6, 2, -4],  # 0x3A ':'
        [95, 2, 6, 6, 2, -4],  # 0x3B ';'
        [97, 4, 5, 6, 1, -5],  # 0x3C '<'
        [100, 4, 5, 6, 1, -4],  # 0x3D '='
        [103, 4, 5, 6, 1, -5],  # 0x3E '>'
        [106, 4, 8, 6, 1, -7],  # 0x3F '?'
        [110, 6, 7, 6, 0, -7],  # 0x40 '@'
        [116, 4, 7, 6, 1, -7],  # 0x41 'A'
        [120, 4, 7, 6, 1, -7],  # 0x42 'B'
        [124, 4, 7, 6, 1, -7],  # 0x43 'C'
        [128, 4, 7, 6, 1, -7],  # 0x44 'D'
        [132, 4, 7, 6, 1, -7],  # 0x45 'E'
        [136, 4, 7, 6, 1, -7],  # 0x46 'F'
        [140, 4, 7, 6, 1, -7],  # 0x47 'G'
        [144, 4, 7, 6, 1, -7],  # 0x48 'H'
        [148, 3, 7, 6, 1, -7],  # 0x49 'I'
        [152, 3, 7, 6, 1, -7],  # 0x4A 'J'
        [156, 4, 7, 6, 1, -7],  # 0x4B 'K'
        [160, 4, 7, 6, 1, -7],  # 0x4C 'L'
        [164, 5, 7, 6, 0, -7],  # 0x4D 'M'
        [169, 5, 7, 6, 0, -7],  # 0x4E 'N'
        [174, 5, 7, 6, 0, -7],  # 0x4F 'O'
        [179, 4, 7, 6, 1, -7],  # 0x50 'P'
        [183, 4, 7, 6, 1, -7],  # 0x51 'Q'
        [187, 4, 7, 6, 1, -7],  # 0x52 'R'
        [191, 4, 7, 6, 1, -7],  # 0x53 'S'
        [195, 5, 7, 6, 0, -7],  # 0x54 'T'
        [200, 4, 7, 6, 1, -7],  # 0x55 'U'
        [204, 5, 7, 6, 0, -7],  # 0x56 'V'
        [209, 5, 7, 6, 0, -7],  # 0x57 'W'
        [214, 5, 7, 6, 0, -7],  # 0x58 'X'
        [219, 5, 7, 6, 0, -7],  # 0x59 'Y'
        [224, 5, 7, 6, 0, -7],  # 0x5A 'Z'
        [229, 2, 7, 6, 2, -7],  # 0x5B ' ['
        [232, 6, 7, 6, 0, -7],  # 0x5C '\'
        [238, 2, 7, 6, 1, -7],  # 0x5D ']'
        [241, 5, 3, 6, 0, -7],  # 0x5E '^'
        [244, 6, 1, 6, 0, 1],  # 0x5F '_'
        [246, 2, 2, 6, 1, -6],  # 0x60 '`'
        [247, 4, 4, 6, 1, -4],  # 0x61 'a'
        [249, 4, 7, 6, 1, -7],  # 0x62 'b'
        [253, 3, 4, 6, 1, -4],  # 0x63 'c'
        [255, 4, 7, 6, 1, -7],  # 0x64 'd'
        [259, 4, 5, 6, 1, -5],  # 0x65 'e'
        [262, 4, 7, 6, 1, -7],  # 0x66 'f'
        [266, 4, 6, 6, 1, -4],  # 0x67 'g'
        [269, 4, 7, 6, 1, -7],  # 0x68 'h'
        [273, 3, 7, 6, 1, -7],  # 0x69 'i'
        [277, 3, 9, 6, 0, -7],  # 0x6A 'j'
        [281, 4, 7, 6, 1, -7],  # 0x6B 'k'
        [285, 4, 7, 6, 1, -7],  # 0x6C 'l'
        [289, 5, 4, 6, 0, -4],  # 0x6D 'm'
        [292, 4, 4, 6, 1, -4],  # 0x6E 'n'
        [294, 4, 4, 6, 1, -4],  # 0x6F 'o'
        [296, 4, 6, 6, 1, -4],  # 0x70 'p'
        [299, 4, 6, 6, 1, -4],  # 0x71 'q'
        [302, 3, 4, 6, 1, -4],  # 0x72 'r'
        [304, 4, 5, 6, 1, -5],  # 0x73 's'
        [307, 4, 6, 6, 1, -6],  # 0x74 't'
        [310, 4, 4, 6, 1, -4],  # 0x75 'u'
        [312, 4, 4, 6, 1, -4],  # 0x76 'v'
        [314, 5, 4, 6, 0, -4],  # 0x77 'w'
        [317, 4, 4, 6, 1, -4],  # 0x78 'x'
        [319, 4, 6, 6, 1, -4],  # 0x79 'y'
        [322, 4, 4, 6, 1, -4],  # 0x7A 'z'
        [324, 3, 7, 6, 1, -7],  # 0x7B '{'
        [328, 1, 8, 6, 2, -7],  # 0x7C '|'
        [329, 3, 7, 6, 1, -7],  # 0x7D '}'
        [333, 4, 3, 4, 0, -5],
    ]  # 0x7E '~'

lbutils.graphics.fonts.org_01

Org01

Bases: BaseFont

A tiny, stylized font with all characters within a 6 pixel height.

Created by fontconvert, from the Org_v01 by Orgdot.

Source code in lbutils/graphics/fonts/org_01.py
 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
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
class Org01(BaseFont):
    """A tiny, stylized font with all characters within a 6 pixel height.

    Created by [`fontconvert`](https://github.com/danjperron/
    ssd1331_micropython.git), from the `Org_v01` by [Orgdot](
    https://www.orgdot.com/aliasfonts).
    """

    def __init__(self) -> None:
        super().__init__(self.bitmap, self.index, self.glyph)

    bitmap = bytes(
        [
            0xE8,
            0xA0,
            0x57,
            0xD5,
            0xF5,
            0x00,
            0xFD,
            0x3E,
            0x5F,
            0x80,
            0x88,
            0x88,
            0x88,
            0x80,
            0xF4,
            0xBF,
            0x2E,
            0x80,
            0x80,
            0x6A,
            0x40,
            0x95,
            0x80,
            0xAA,
            0x80,
            0x5D,
            0x00,
            0xC0,
            0xF0,
            0x80,
            0x08,
            0x88,
            0x88,
            0x00,
            0xFC,
            0x63,
            0x1F,
            0x80,
            0xF8,
            0xF8,
            0x7F,
            0x0F,
            0x80,
            0xF8,
            0x7E,
            0x1F,
            0x80,
            0x8C,
            0x7E,
            0x10,
            0x80,
            0xFC,
            0x3E,
            0x1F,
            0x80,
            0xFC,
            0x3F,
            0x1F,
            0x80,
            0xF8,
            0x42,
            0x10,
            0x80,
            0xFC,
            0x7F,
            0x1F,
            0x80,
            0xFC,
            0x7E,
            0x1F,
            0x80,
            0x90,
            0xB0,
            0x2A,
            0x22,
            0xF0,
            0xF0,
            0x88,
            0xA8,
            0xF8,
            0x4E,
            0x02,
            0x00,
            0xFD,
            0x6F,
            0x0F,
            0x80,
            0xFC,
            0x7F,
            0x18,
            0x80,
            0xF4,
            0x7D,
            0x1F,
            0x00,
            0xFC,
            0x21,
            0x0F,
            0x80,
            0xF4,
            0x63,
            0x1F,
            0x00,
            0xFC,
            0x3F,
            0x0F,
            0x80,
            0xFC,
            0x3F,
            0x08,
            0x00,
            0xFC,
            0x2F,
            0x1F,
            0x80,
            0x8C,
            0x7F,
            0x18,
            0x80,
            0xF9,
            0x08,
            0x4F,
            0x80,
            0x78,
            0x85,
            0x2F,
            0x80,
            0x8D,
            0xB1,
            0x68,
            0x80,
            0x84,
            0x21,
            0x0F,
            0x80,
            0xFD,
            0x6B,
            0x5A,
            0x80,
            0xFC,
            0x63,
            0x18,
            0x80,
            0xFC,
            0x63,
            0x1F,
            0x80,
            0xFC,
            0x7F,
            0x08,
            0x00,
            0xFC,
            0x63,
            0x3F,
            0x80,
            0xFC,
            0x7F,
            0x29,
            0x00,
            0xFC,
            0x3E,
            0x1F,
            0x80,
            0xF9,
            0x08,
            0x42,
            0x00,
            0x8C,
            0x63,
            0x1F,
            0x80,
            0x8C,
            0x62,
            0xA2,
            0x00,
            0xAD,
            0x6B,
            0x5F,
            0x80,
            0x8A,
            0x88,
            0xA8,
            0x80,
            0x8C,
            0x54,
            0x42,
            0x00,
            0xF8,
            0x7F,
            0x0F,
            0x80,
            0xEA,
            0xC0,
            0x82,
            0x08,
            0x20,
            0x80,
            0xD5,
            0xC0,
            0x54,
            0xF8,
            0x80,
            0xF1,
            0xFF,
            0x8F,
            0x99,
            0xF0,
            0xF8,
            0x8F,
            0x1F,
            0x99,
            0xF0,
            0xFF,
            0x8F,
            0x6B,
            0xA4,
            0xF9,
            0x9F,
            0x10,
            0x8F,
            0x99,
            0x90,
            0xF0,
            0x55,
            0xC0,
            0x8A,
            0xF9,
            0x90,
            0xF8,
            0xFD,
            0x63,
            0x10,
            0xF9,
            0x99,
            0xF9,
            0x9F,
            0xF9,
            0x9F,
            0x80,
            0xF9,
            0x9F,
            0x20,
            0xF8,
            0x88,
            0x47,
            0x1F,
            0x27,
            0xC8,
            0x42,
            0x00,
            0x99,
            0x9F,
            0x99,
            0x97,
            0x8C,
            0x6B,
            0xF0,
            0x96,
            0x69,
            0x99,
            0x9F,
            0x10,
            0x2E,
            0x8F,
            0x2B,
            0x22,
            0xF8,
            0x89,
            0xA8,
            0x0F,
            0xE0,
        ],
    )

    index = {
        " ": 0,
        "!": 1,
        '"': 2,
        "#": 3,
        "$": 4,
        "%": 5,
        "&": 6,
        "'": 7,
        "(": 8,
        ")": 9,
        "*": 10,
        "+": 11,
        ",": 12,
        "-": 13,
        ".": 14,
        "/": 15,
        "0": 16,
        "1": 17,
        "2": 18,
        "3": 19,
        "4": 20,
        "5": 21,
        "6": 22,
        "7": 23,
        "8": 24,
        "9": 25,
        ":": 26,
        ";": 27,
        "<": 28,
        "=": 29,
        ">": 30,
        "?": 31,
        "@": 32,
        "A": 33,
        "B": 34,
        "C": 35,
        "D": 36,
        "E": 37,
        "F": 38,
        "G": 39,
        "H": 40,
        "I": 41,
        "J": 42,
        "K": 43,
        "L": 44,
        "M": 45,
        "N": 46,
        "O": 47,
        "P": 48,
        "Q": 49,
        "R": 50,
        "S": 51,
        "T": 52,
        "U": 53,
        "V": 54,
        "W": 55,
        "X": 56,
        "Y": 57,
        "Z": 58,
        "[": 59,
        "\\": 60,
        "]": 61,
        "^": 62,
        "_": 63,
        "`": 64,
        "a": 65,
        "b": 66,
        "c": 67,
        "d": 68,
        "e": 69,
        "f": 70,
        "g": 71,
        "h": 72,
        "i": 73,
        "j": 74,
        "k": 75,
        "l": 76,
        "m": 77,
        "n": 78,
        "o": 79,
        "p": 80,
        "q": 81,
        "r": 82,
        "s": 83,
        "t": 84,
        "u": 85,
        "v": 86,
        "w": 87,
        "x": 88,
        "y": 89,
        "z": 90,
        "{": 91,
        "|": 92,
        "}": 93,
        "~": 94,
    }

    glyph = [
        [0, 0, 0, 6, 0, 1],  # 0x20 ' '
        [0, 1, 5, 2, 0, -4],  # 0x21 '!'
        [1, 3, 1, 4, 0, -4],  # 0x22 '"'
        [2, 5, 5, 6, 0, -4],  # 0x23 '#'
        [6, 5, 5, 6, 0, -4],  # 0x24 '$'
        [10, 5, 5, 6, 0, -4],  # 0x25 '%'
        [14, 5, 5, 6, 0, -4],  # 0x26 '&'
        [18, 1, 1, 2, 0, -4],  # 0x27 '''
        [19, 2, 5, 3, 0, -4],  # 0x28 '('
        [21, 2, 5, 3, 0, -4],  # 0x29 ')'
        [23, 3, 3, 4, 0, -3],  # 0x2A '*'
        [25, 3, 3, 4, 0, -3],  # 0x2B '+'
        [27, 1, 2, 2, 0, 0],  # 0x2C ','
        [28, 4, 1, 5, 0, -2],  # 0x2D '-'
        [29, 1, 1, 2, 0, 0],  # 0x2E '.'
        [30, 5, 5, 6, 0, -4],  # 0x2F '/'
        [34, 5, 5, 6, 0, -4],  # 0x30 '0'
        [38, 1, 5, 2, 0, -4],  # 0x31 '1'
        [39, 5, 5, 6, 0, -4],  # 0x32 '2'
        [43, 5, 5, 6, 0, -4],  # 0x33 '3'
        [47, 5, 5, 6, 0, -4],  # 0x34 '4'
        [51, 5, 5, 6, 0, -4],  # 0x35 '5'
        [55, 5, 5, 6, 0, -4],  # 0x36 '6'
        [59, 5, 5, 6, 0, -4],  # 0x37 '7'
        [63, 5, 5, 6, 0, -4],  # 0x38 '8'
        [67, 5, 5, 6, 0, -4],  # 0x39 '9'
        [71, 1, 4, 2, 0, -3],  # 0x3A ':'
        [72, 1, 4, 2, 0, -3],  # 0x3B ';'
        [73, 3, 5, 4, 0, -4],  # 0x3C '<'
        [75, 4, 3, 5, 0, -3],  # 0x3D '='
        [77, 3, 5, 4, 0, -4],  # 0x3E '>'
        [79, 5, 5, 6, 0, -4],  # 0x3F '?'
        [83, 5, 5, 6, 0, -4],  # 0x40 '@'
        [87, 5, 5, 6, 0, -4],  # 0x41 'A'
        [91, 5, 5, 6, 0, -4],  # 0x42 'B'
        [95, 5, 5, 6, 0, -4],  # 0x43 'C'
        [99, 5, 5, 6, 0, -4],  # 0x44 'D'
        [103, 5, 5, 6, 0, -4],  # 0x45 'E'
        [107, 5, 5, 6, 0, -4],  # 0x46 'F'
        [111, 5, 5, 6, 0, -4],  # 0x47 'G'
        [115, 5, 5, 6, 0, -4],  # 0x48 'H'
        [119, 5, 5, 6, 0, -4],  # 0x49 'I'
        [123, 5, 5, 6, 0, -4],  # 0x4A 'J'
        [127, 5, 5, 6, 0, -4],  # 0x4B 'K'
        [131, 5, 5, 6, 0, -4],  # 0x4C 'L'
        [135, 5, 5, 6, 0, -4],  # 0x4D 'M'
        [139, 5, 5, 6, 0, -4],  # 0x4E 'N'
        [143, 5, 5, 6, 0, -4],  # 0x4F 'O'
        [147, 5, 5, 6, 0, -4],  # 0x50 'P'
        [151, 5, 5, 6, 0, -4],  # 0x51 'Q'
        [155, 5, 5, 6, 0, -4],  # 0x52 'R'
        [159, 5, 5, 6, 0, -4],  # 0x53 'S'
        [163, 5, 5, 6, 0, -4],  # 0x54 'T'
        [167, 5, 5, 6, 0, -4],  # 0x55 'U'
        [171, 5, 5, 6, 0, -4],  # 0x56 'V'
        [175, 5, 5, 6, 0, -4],  # 0x57 'W'
        [179, 5, 5, 6, 0, -4],  # 0x58 'X'
        [183, 5, 5, 6, 0, -4],  # 0x59 'Y'
        [187, 5, 5, 6, 0, -4],  # 0x5A 'Z'
        [191, 2, 5, 3, 0, -4],  # 0x5B '['
        [193, 5, 5, 6, 0, -4],  # 0x5C '\'
        [197, 2, 5, 3, 0, -4],  # 0x5D ']'
        [199, 3, 2, 4, 0, -4],  # 0x5E '^'
        [200, 5, 1, 6, 0, 1],  # 0x5F '_'
        [201, 1, 1, 2, 0, -4],  # 0x60 '`'
        [202, 4, 4, 5, 0, -3],  # 0x61 'a'
        [204, 4, 5, 5, 0, -4],  # 0x62 'b'
        [207, 4, 4, 5, 0, -3],  # 0x63 'c'
        [209, 4, 5, 5, 0, -4],  # 0x64 'd'
        [212, 4, 4, 5, 0, -3],  # 0x65 'e'
        [214, 3, 5, 4, 0, -4],  # 0x66 'f'
        [216, 4, 5, 5, 0, -3],  # 0x67 'g'
        [219, 4, 5, 5, 0, -4],  # 0x68 'h'
        [222, 1, 4, 2, 0, -3],  # 0x69 'i'
        [223, 2, 5, 3, 0, -3],  # 0x6A 'j'
        [225, 4, 5, 5, 0, -4],  # 0x6B 'k'
        [228, 1, 5, 2, 0, -4],  # 0x6C 'l'
        [229, 5, 4, 6, 0, -3],  # 0x6D 'm'
        [232, 4, 4, 5, 0, -3],  # 0x6E 'n'
        [234, 4, 4, 5, 0, -3],  # 0x6F 'o'
        [236, 4, 5, 5, 0, -3],  # 0x70 'p'
        [239, 4, 5, 5, 0, -3],  # 0x71 'q'
        [242, 4, 4, 5, 0, -3],  # 0x72 'r'
        [244, 4, 4, 5, 0, -3],  # 0x73 's'
        [246, 5, 5, 6, 0, -4],  # 0x74 't'
        [250, 4, 4, 5, 0, -3],  # 0x75 'u'
        [252, 4, 4, 5, 0, -3],  # 0x76 'v'
        [254, 5, 4, 6, 0, -3],  # 0x77 'w'
        [257, 4, 4, 5, 0, -3],  # 0x78 'x'
        [259, 4, 5, 5, 0, -3],  # 0x79 'y'
        [262, 4, 4, 5, 0, -3],  # 0x7A 'z'
        [264, 3, 5, 4, 0, -4],  # 0x7B '{'
        [266, 1, 5, 2, 0, -4],  # 0x7C '|'
        [267, 3, 5, 4, 0, -4],  # 0x7D '}'
        [269, 5, 3, 6, 0, -3],
    ]  # 0x7E '~'