Skip to content

Commit 26262cd

Browse files
authored
Merge pull request #1670 from tannewt/fontio
Move Glyph and BuiltinFont into fontio
2 parents 6f288eb + 4d4b7ad commit 26262cd

28 files changed

+940
-799
lines changed

locale/ID.po

Lines changed: 74 additions & 72 deletions
Large diffs are not rendered by default.

locale/circuitpython.pot

Lines changed: 74 additions & 72 deletions
Large diffs are not rendered by default.

locale/de_DE.po

Lines changed: 74 additions & 72 deletions
Large diffs are not rendered by default.

locale/en_US.po

Lines changed: 74 additions & 72 deletions
Large diffs are not rendered by default.

locale/en_x_pirate.po

Lines changed: 74 additions & 72 deletions
Large diffs are not rendered by default.

locale/es.po

Lines changed: 74 additions & 72 deletions
Large diffs are not rendered by default.

locale/fil.po

Lines changed: 74 additions & 72 deletions
Large diffs are not rendered by default.

locale/fr.po

Lines changed: 74 additions & 72 deletions
Large diffs are not rendered by default.

locale/it_IT.po

Lines changed: 74 additions & 72 deletions
Large diffs are not rendered by default.

locale/pt_BR.po

Lines changed: 74 additions & 72 deletions
Large diffs are not rendered by default.

py/circuitpy_defns.mk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ ifeq ($(CIRCUITPY_DIGITALIO),1)
124124
SRC_PATTERNS += digitalio/%
125125
endif
126126
ifeq ($(CIRCUITPY_DISPLAYIO),1)
127-
SRC_PATTERNS += displayio/% terminalio/%
127+
SRC_PATTERNS += displayio/% terminalio/% fontio/%
128128
endif
129129
ifeq ($(CIRCUITPY_FREQUENCYIO),1)
130130
SRC_PATTERNS += frequencyio/%
@@ -268,7 +268,7 @@ $(filter $(SRC_PATTERNS), \
268268
digitalio/Direction.c \
269269
digitalio/DriveMode.c \
270270
digitalio/Pull.c \
271-
displayio/Glyph.c \
271+
fontio/Glyph.c \
272272
microcontroller/RunMode.c \
273273
math/__init__.c \
274274
supervisor/__init__.c \
@@ -304,7 +304,6 @@ $(filter $(SRC_PATTERNS), \
304304
bitbangio/__init__.c \
305305
busio/OneWire.c \
306306
displayio/Bitmap.c \
307-
displayio/BuiltinFont.c \
308307
displayio/ColorConverter.c \
309308
displayio/Display.c \
310309
displayio/FourWire.c \
@@ -314,6 +313,8 @@ $(filter $(SRC_PATTERNS), \
314313
displayio/Shape.c \
315314
displayio/TileGrid.c \
316315
displayio/__init__.c \
316+
fontio/BuiltinFont.c \
317+
fontio/__init__.c \
317318
gamepad/GamePad.c \
318319
gamepad/__init__.c \
319320
os/__init__.c \

py/circuitpy_mpconfig.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,15 @@ extern const struct _mp_obj_module_t digitalio_module;
272272

273273
#if CIRCUITPY_DISPLAYIO
274274
extern const struct _mp_obj_module_t displayio_module;
275+
extern const struct _mp_obj_module_t fontio_module;
275276
extern const struct _mp_obj_module_t terminalio_module;
276277
#define DISPLAYIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_displayio), (mp_obj_t)&displayio_module },
278+
#define FONTIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_fontio), (mp_obj_t)&fontio_module },
277279
#define TERMINALIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_terminalio), (mp_obj_t)&terminalio_module },
278280
#define CIRCUITPY_DISPLAY_LIMIT (3)
279281
#else
280282
#define DISPLAYIO_MODULE
283+
#define FONTIO_MODULE
281284
#define TERMINALIO_MODULE
282285
#define CIRCUITPY_DISPLAY_LIMIT (0)
283286
#endif
@@ -524,8 +527,9 @@ extern const struct _mp_obj_module_t pew_module;
524527
BOARD_MODULE \
525528
BUSIO_MODULE \
526529
DIGITALIO_MODULE \
527-
TERMINALIO_MODULE \
528530
DISPLAYIO_MODULE \
531+
FONTIO_MODULE \
532+
TERMINALIO_MODULE \
529533
ERRNO_MODULE \
530534
FREQUENCYIO_MODULE \
531535
GAMEPAD_MODULE \

shared-bindings/displayio/__init__.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@
3131

3232
#include "shared-bindings/displayio/__init__.h"
3333
#include "shared-bindings/displayio/Bitmap.h"
34-
#include "shared-bindings/displayio/BuiltinFont.h"
3534
#include "shared-bindings/displayio/ColorConverter.h"
3635
#include "shared-bindings/displayio/Display.h"
3736
#include "shared-bindings/displayio/FourWire.h"
38-
#include "shared-bindings/displayio/Glyph.h"
3937
#include "shared-bindings/displayio/Group.h"
4038
#include "shared-bindings/displayio/OnDiskBitmap.h"
4139
#include "shared-bindings/displayio/Palette.h"
@@ -59,11 +57,9 @@
5957
//| :maxdepth: 3
6058
//|
6159
//| Bitmap
62-
//| BuiltinFont
6360
//| ColorConverter
6461
//| Display
6562
//| FourWire
66-
//| Glyph
6763
//| Group
6864
//| OnDiskBitmap
6965
//| Palette
@@ -91,10 +87,8 @@ MP_DEFINE_CONST_FUN_OBJ_0(displayio_release_displays_obj, displayio_release_disp
9187
STATIC const mp_rom_map_elem_t displayio_module_globals_table[] = {
9288
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_displayio) },
9389
{ MP_ROM_QSTR(MP_QSTR_Bitmap), MP_ROM_PTR(&displayio_bitmap_type) },
94-
{ MP_ROM_QSTR(MP_QSTR_BuiltinFont), MP_ROM_PTR(&displayio_builtinfont_type) },
9590
{ MP_ROM_QSTR(MP_QSTR_ColorConverter), MP_ROM_PTR(&displayio_colorconverter_type) },
9691
{ MP_ROM_QSTR(MP_QSTR_Display), MP_ROM_PTR(&displayio_display_type) },
97-
{ MP_ROM_QSTR(MP_QSTR_Glyph), MP_ROM_PTR(&displayio_glyph_type) },
9892
{ MP_ROM_QSTR(MP_QSTR_Group), MP_ROM_PTR(&displayio_group_type) },
9993
{ MP_ROM_QSTR(MP_QSTR_OnDiskBitmap), MP_ROM_PTR(&displayio_ondiskbitmap_type) },
10094
{ MP_ROM_QSTR(MP_QSTR_Palette), MP_ROM_PTR(&displayio_palette_type) },

shared-bindings/displayio/BuiltinFont.c renamed to shared-bindings/fontio/BuiltinFont.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#include "shared-bindings/displayio/BuiltinFont.h"
27+
#include "shared-bindings/fontio/BuiltinFont.h"
2828

2929
#include <stdint.h>
3030

@@ -36,7 +36,7 @@
3636
#include "shared-bindings/util.h"
3737
#include "supervisor/shared/translate.h"
3838

39-
//| .. currentmodule:: displayio
39+
//| .. currentmodule:: fontio
4040
//|
4141
//| :class:`BuiltinFont` -- A font built into CircuitPython
4242
//| =========================================================================================
@@ -56,15 +56,15 @@
5656
//| `get_glyph` in most cases. This is useful for use with `displayio.TileGrid` and
5757
//| `terminalio.Terminal`.
5858
//|
59-
STATIC mp_obj_t displayio_builtinfont_obj_get_bitmap(mp_obj_t self_in) {
60-
displayio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in);
61-
return common_hal_displayio_builtinfont_get_bitmap(self);
59+
STATIC mp_obj_t fontio_builtinfont_obj_get_bitmap(mp_obj_t self_in) {
60+
fontio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in);
61+
return common_hal_fontio_builtinfont_get_bitmap(self);
6262
}
63-
MP_DEFINE_CONST_FUN_OBJ_1(displayio_builtinfont_get_bitmap_obj, displayio_builtinfont_obj_get_bitmap);
63+
MP_DEFINE_CONST_FUN_OBJ_1(fontio_builtinfont_get_bitmap_obj, fontio_builtinfont_obj_get_bitmap);
6464

65-
const mp_obj_property_t displayio_builtinfont_bitmap_obj = {
65+
const mp_obj_property_t fontio_builtinfont_bitmap_obj = {
6666
.base.type = &mp_type_property,
67-
.proxy = {(mp_obj_t)&displayio_builtinfont_get_bitmap_obj,
67+
.proxy = {(mp_obj_t)&fontio_builtinfont_get_bitmap_obj,
6868
(mp_obj_t)&mp_const_none_obj,
6969
(mp_obj_t)&mp_const_none_obj},
7070
};
@@ -73,38 +73,38 @@ const mp_obj_property_t displayio_builtinfont_bitmap_obj = {
7373
//|
7474
//| Returns the maximum bounds of all glyphs in the font in a tuple of two values: width, height.
7575
//|
76-
STATIC mp_obj_t displayio_builtinfont_obj_get_bounding_box(mp_obj_t self_in) {
77-
displayio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in);
76+
STATIC mp_obj_t fontio_builtinfont_obj_get_bounding_box(mp_obj_t self_in) {
77+
fontio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in);
7878

79-
return common_hal_displayio_builtinfont_get_bounding_box(self);
79+
return common_hal_fontio_builtinfont_get_bounding_box(self);
8080
}
81-
MP_DEFINE_CONST_FUN_OBJ_1(displayio_builtinfont_get_bounding_box_obj, displayio_builtinfont_obj_get_bounding_box);
81+
MP_DEFINE_CONST_FUN_OBJ_1(fontio_builtinfont_get_bounding_box_obj, fontio_builtinfont_obj_get_bounding_box);
8282

8383

8484
//| .. method:: get_glyph(codepoint)
8585
//|
86-
//| Returns a `displayio.Glyph` for the given codepoint or None if no glyph is available.
86+
//| Returns a `fontio.Glyph` for the given codepoint or None if no glyph is available.
8787
//|
88-
STATIC mp_obj_t displayio_builtinfont_obj_get_glyph(mp_obj_t self_in, mp_obj_t codepoint_obj) {
89-
displayio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in);
88+
STATIC mp_obj_t fontio_builtinfont_obj_get_glyph(mp_obj_t self_in, mp_obj_t codepoint_obj) {
89+
fontio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in);
9090

9191
mp_int_t codepoint;
9292
if (!mp_obj_get_int_maybe(codepoint_obj, &codepoint)) {
9393
mp_raise_ValueError_varg(translate("%q should be an int"), MP_QSTR_codepoint);
9494
}
95-
return common_hal_displayio_builtinfont_get_glyph(self, codepoint);
95+
return common_hal_fontio_builtinfont_get_glyph(self, codepoint);
9696
}
97-
MP_DEFINE_CONST_FUN_OBJ_2(displayio_builtinfont_get_glyph_obj, displayio_builtinfont_obj_get_glyph);
97+
MP_DEFINE_CONST_FUN_OBJ_2(fontio_builtinfont_get_glyph_obj, fontio_builtinfont_obj_get_glyph);
9898

99-
STATIC const mp_rom_map_elem_t displayio_builtinfont_locals_dict_table[] = {
100-
{ MP_ROM_QSTR(MP_QSTR_bitmap), MP_ROM_PTR(&displayio_builtinfont_bitmap_obj) },
101-
{ MP_ROM_QSTR(MP_QSTR_get_bounding_box), MP_ROM_PTR(&displayio_builtinfont_get_bounding_box_obj) },
102-
{ MP_ROM_QSTR(MP_QSTR_get_glyph), MP_ROM_PTR(&displayio_builtinfont_get_glyph_obj) },
99+
STATIC const mp_rom_map_elem_t fontio_builtinfont_locals_dict_table[] = {
100+
{ MP_ROM_QSTR(MP_QSTR_bitmap), MP_ROM_PTR(&fontio_builtinfont_bitmap_obj) },
101+
{ MP_ROM_QSTR(MP_QSTR_get_bounding_box), MP_ROM_PTR(&fontio_builtinfont_get_bounding_box_obj) },
102+
{ MP_ROM_QSTR(MP_QSTR_get_glyph), MP_ROM_PTR(&fontio_builtinfont_get_glyph_obj) },
103103
};
104-
STATIC MP_DEFINE_CONST_DICT(displayio_builtinfont_locals_dict, displayio_builtinfont_locals_dict_table);
104+
STATIC MP_DEFINE_CONST_DICT(fontio_builtinfont_locals_dict, fontio_builtinfont_locals_dict_table);
105105

106-
const mp_obj_type_t displayio_builtinfont_type = {
106+
const mp_obj_type_t fontio_builtinfont_type = {
107107
{ &mp_type_type },
108108
.name = MP_QSTR_BuiltinFont,
109-
.locals_dict = (mp_obj_dict_t*)&displayio_builtinfont_locals_dict,
109+
.locals_dict = (mp_obj_dict_t*)&fontio_builtinfont_locals_dict,
110110
};

shared-bindings/displayio/BuiltinFont.h renamed to shared-bindings/fontio/BuiltinFont.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_BUILTINFONT_H
28-
#define MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_BUILTINFONT_H
27+
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_FONTIO_BUILTINFONT_H
28+
#define MICROPY_INCLUDED_SHARED_BINDINGS_FONTIO_BUILTINFONT_H
2929

30-
#include "shared-module/displayio/BuiltinFont.h"
30+
#include "shared-module/fontio/BuiltinFont.h"
3131

32-
extern const mp_obj_type_t displayio_builtinfont_type;
32+
extern const mp_obj_type_t fontio_builtinfont_type;
3333

34-
mp_obj_t common_hal_displayio_builtinfont_get_bitmap(const displayio_builtinfont_t *self);
35-
mp_obj_t common_hal_displayio_builtinfont_get_bounding_box(const displayio_builtinfont_t *self);
36-
mp_obj_t common_hal_displayio_builtinfont_get_glyph(const displayio_builtinfont_t *self, mp_uint_t codepoint);
34+
mp_obj_t common_hal_fontio_builtinfont_get_bitmap(const fontio_builtinfont_t *self);
35+
mp_obj_t common_hal_fontio_builtinfont_get_bounding_box(const fontio_builtinfont_t *self);
36+
mp_obj_t common_hal_fontio_builtinfont_get_glyph(const fontio_builtinfont_t *self, mp_uint_t codepoint);
3737

38-
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_BUILTINFONT_H
38+
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_FONTIO_BUILTINFONT_H

shared-bindings/displayio/Glyph.c renamed to shared-bindings/fontio/Glyph.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#include "shared-bindings/displayio/Glyph.h"
27+
#include "shared-bindings/fontio/Glyph.h"
2828

2929
#include <stdint.h>
3030

31-
//| .. currentmodule:: displayio
31+
//| .. currentmodule:: fontio
3232
//|
3333
//| :class:`Glyph` -- Storage of glyph info
3434
//| ==========================================================================
@@ -37,7 +37,7 @@
3737
//|
3838
//| Named tuple used to capture a single glyph and its attributes.
3939
//|
40-
//| :param displayio.Bitmap bitmap: the bitmap including the glyph
40+
//| :param fontio.Bitmap bitmap: the bitmap including the glyph
4141
//| :param int tile_index: the tile index within the bitmap
4242
//| :param int width: the width of the glyph's bitmap
4343
//| :param int height: the height of the glyph's bitmap
@@ -46,7 +46,7 @@
4646
//| :param int shift_x: the x difference to the next glyph
4747
//| :param int shift_y: the y difference to the next glyph
4848
//|
49-
const mp_obj_namedtuple_type_t displayio_glyph_type = {
49+
const mp_obj_namedtuple_type_t fontio_glyph_type = {
5050
.base = {
5151
.base = {
5252
.type = &mp_type_type

shared-bindings/displayio/Glyph.h renamed to shared-bindings/fontio/Glyph.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_GLYPH_H
28-
#define MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_GLYPH_H
27+
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_FONTIO_GLYPH_H
28+
#define MICROPY_INCLUDED_SHARED_BINDINGS_FONTIO_GLYPH_H
2929

3030
#include "py/objnamedtuple.h"
3131

32-
extern const mp_obj_namedtuple_type_t displayio_glyph_type;
32+
extern const mp_obj_namedtuple_type_t fontio_glyph_type;
3333

34-
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_GLYPH_H
34+
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_FONTIO_GLYPH_H

shared-bindings/fontio/__init__.c

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2019 Scott Shawcroft for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include <stdint.h>
28+
29+
#include "py/obj.h"
30+
#include "py/runtime.h"
31+
32+
#include "shared-bindings/fontio/__init__.h"
33+
#include "shared-bindings/fontio/BuiltinFont.h"
34+
#include "shared-bindings/fontio/Glyph.h"
35+
36+
//| :mod:`fontio` --- Core font related data structures
37+
//| =========================================================================
38+
//|
39+
//| .. module:: fontio
40+
//| :synopsis: Core font related data structures
41+
//| :platform: SAMD21, SAMD51, nRF52
42+
//|
43+
//| The `fontio` module contains classes to store font related information.
44+
//|
45+
//| Libraries
46+
//|
47+
//| .. toctree::
48+
//| :maxdepth: 3
49+
//|
50+
//| BuiltinFont
51+
//| Glyph
52+
//|
53+
54+
STATIC const mp_rom_map_elem_t fontio_module_globals_table[] = {
55+
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_fontio) },
56+
{ MP_ROM_QSTR(MP_QSTR_BuiltinFont), MP_ROM_PTR(&fontio_builtinfont_type) },
57+
{ MP_ROM_QSTR(MP_QSTR_Glyph), MP_ROM_PTR(&fontio_glyph_type) },
58+
};
59+
60+
STATIC MP_DEFINE_CONST_DICT(fontio_module_globals, fontio_module_globals_table);
61+
62+
const mp_obj_module_t fontio_module = {
63+
.base = { &mp_type_module },
64+
.globals = (mp_obj_dict_t*)&fontio_module_globals,
65+
};

shared-bindings/fontio/__init__.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2018 Scott Shawcroft for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_FONTIO___INIT___H
28+
#define MICROPY_INCLUDED_SHARED_BINDINGS_FONTIO___INIT___H
29+
30+
31+
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_FONTIO___INIT___H

shared-bindings/terminalio/Terminal.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "py/objstr.h"
3535
#include "py/runtime.h"
3636
#include "py/stream.h"
37-
#include "shared-bindings/displayio/BuiltinFont.h"
37+
#include "shared-bindings/fontio/BuiltinFont.h"
3838
#include "supervisor/shared/translate.h"
3939

4040

@@ -46,7 +46,7 @@
4646
//| .. class:: Terminal(tilegrid, font)
4747
//|
4848
//| Terminal manages tile indices and cursor position based on VT100 commands. The font should be
49-
//| a `displayio.BuiltinFont` and the TileGrid's bitmap should match the font's bitmap.
49+
//| a `fontio.BuiltinFont` and the TileGrid's bitmap should match the font's bitmap.
5050
//|
5151

5252
STATIC mp_obj_t terminalio_terminal_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
@@ -64,8 +64,8 @@ STATIC mp_obj_t terminalio_terminal_make_new(const mp_obj_type_t *type, size_t n
6464
}
6565

6666
mp_obj_t font = args[ARG_font].u_obj;
67-
if (!MP_OBJ_IS_TYPE(font, &displayio_builtinfont_type)) {
68-
mp_raise_TypeError_varg(translate("Expected a %q"), displayio_builtinfont_type.name);
67+
if (!MP_OBJ_IS_TYPE(font, &fontio_builtinfont_type)) {
68+
mp_raise_TypeError_varg(translate("Expected a %q"), fontio_builtinfont_type.name);
6969
}
7070
terminalio_terminal_obj_t *self = m_new_obj(terminalio_terminal_obj_t);
7171
self->base.type = &terminalio_terminal_type;

shared-bindings/terminalio/Terminal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
extern const mp_obj_type_t terminalio_terminal_type;
3535

3636
extern void common_hal_terminalio_terminal_construct(terminalio_terminal_obj_t *self,
37-
displayio_tilegrid_t* tilegrid, const displayio_builtinfont_t* font);
37+
displayio_tilegrid_t* tilegrid, const fontio_builtinfont_t* font);
3838

3939
// Write characters. len is in characters NOT bytes!
4040
extern size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self,

0 commit comments

Comments
 (0)