Skip to content

Commit 92c121b

Browse files
authored
Merge pull request #10208 from tannewt/lvfontio
Add support for on disk fonts to terminalio
2 parents 25216c8 + 565518e commit 92c121b

File tree

38 files changed

+1749
-155
lines changed

38 files changed

+1749
-155
lines changed

.github/actions/deps/ports/broadcom/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ runs:
55
steps:
66
- name: Get broadcom toolchain
77
run: |
8-
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz
9-
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz
8+
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/arm-gnu-toolchain-13.3.rel1-x86_64-aarch64-none-elf.tar.xz
9+
sudo tar -C /usr --strip-components=1 -xaf arm-gnu-toolchain-13.3.rel1-x86_64-aarch64-none-elf.tar.xz
1010
sudo apt-get update
1111
sudo apt-get install -y mtools
1212
shell: bash

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,8 @@ TAGS
9797
# clangd cache
9898
##############
9999
.cache
100+
101+
**/CLAUDE.local.md
102+
103+
# windsurf rules
104+
.windsurfrules

docs/environment.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,18 @@ This feature is not enabled on boards that the CIRCUITPY_OS_GETENV (os CIRCUIPTY
189189
flag has been set to 0. Currently this is primarily boards with limited flash including some
190190
of the Atmel_samd boards based on the SAMD21/M0 microprocessor.
191191

192+
CIRCUITPY_TERMINAL_FONT
193+
~~~~~~~~~~~~~~~~~~~~~~~
194+
Specifies a custom font file path to use for the terminalio console instead of the default
195+
``/fonts/terminal.lvfontbin``. This allows users to create and use custom fonts for the
196+
CircuitPython console.
197+
198+
This feature requires both CIRCUITPY_OS_GETENV and CIRCUITPY_LVFONTIO to be enabled.
199+
200+
Example:
201+
202+
.. code-block::
203+
204+
CIRCUITPY_TERMINAL_FONT="/fonts/myfont.lvfontbin"
205+
192206
`boards that the terminalio core module is available on <https://docs.circuitpython.org/en/latest/shared-bindings/terminalio/>`_

locale/circuitpython.pot

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ msgstr ""
10511051
msgid "File exists"
10521052
msgstr ""
10531053

1054-
#: shared-module/os/getenv.c
1054+
#: shared-module/lvfontio/OnDiskFont.c shared-module/os/getenv.c
10551055
msgid "File not found"
10561056
msgstr ""
10571057

@@ -1247,6 +1247,7 @@ msgstr ""
12471247
#: shared-bindings/digitalio/DigitalInOut.c
12481248
#: shared-bindings/epaperdisplay/EPaperDisplay.c shared-bindings/pwmio/PWMOut.c
12491249
#: shared-module/aurora_epaper/aurora_framebuffer.c
1250+
#: shared-module/lvfontio/OnDiskFont.c
12501251
msgid "Invalid %q"
12511252
msgstr ""
12521253

@@ -1975,6 +1976,7 @@ msgstr ""
19751976
#: shared-bindings/displayio/TileGrid.c
19761977
#: shared-bindings/memorymonitor/AllocationSize.c
19771978
#: shared-bindings/pulseio/PulseIn.c
1979+
#: shared-bindings/tilepalettemapper/TilePaletteMapper.c
19781980
msgid "Slices not supported"
19791981
msgstr ""
19801982

@@ -2042,7 +2044,9 @@ msgstr ""
20422044
msgid "Tile height must exactly divide bitmap height"
20432045
msgstr ""
20442046

2045-
#: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c
2047+
#: shared-bindings/displayio/TileGrid.c
2048+
#: shared-bindings/tilepalettemapper/TilePaletteMapper.c
2049+
#: shared-module/displayio/TileGrid.c
20462050
msgid "Tile index out of bounds"
20472051
msgstr ""
20482052

@@ -4277,7 +4281,9 @@ msgstr ""
42774281
msgid "unreadable attribute"
42784282
msgstr ""
42794283

4280-
#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c
4284+
#: shared-bindings/displayio/TileGrid.c shared-bindings/terminalio/Terminal.c
4285+
#: shared-bindings/tilepalettemapper/TilePaletteMapper.c
4286+
#: shared-bindings/vectorio/VectorShape.c
42814287
msgid "unsupported %q type"
42824288
msgstr ""
42834289

ports/atmel-samd/mpconfigport.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1
1212
CIRCUITPY_LTO = 1
1313

1414
CIRCUITPY_KEYPAD_DEMUX ?= 0
15+
CIRCUITPY_LVFONTIO ?= 0
1516

1617
######################################################################
1718
# Put samd21-only choices here.

ports/raspberrypi/common-hal/picodvi/__init__.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ static bool picodvi_autoconstruct_enabled(mp_int_t *default_width, mp_int_t *def
7474
if ((established_timings & 0x80) != 0 &&
7575
preferred_width % 1920 == 0 &&
7676
preferred_height % 1080 == 0) {
77-
*default_width = 720 / 2;
78-
*default_height = 400 / 2;
77+
*default_width = 720;
78+
*default_height = 400;
7979
} else {
80-
*default_width = 640 / 2;
81-
*default_height = 480 / 2;
80+
*default_width = 640;
81+
*default_height = 480;
8282
}
8383
}
8484
}
@@ -95,15 +95,15 @@ void picodvi_autoconstruct(void) {
9595
return;
9696
}
9797

98-
mp_int_t default_width = 320;
99-
mp_int_t default_height = 240;
98+
mp_int_t default_width = 640;
99+
mp_int_t default_height = 480;
100100
if (!picodvi_autoconstruct_enabled(&default_width, &default_height)) {
101101
return;
102102
}
103103

104104
mp_int_t width = default_width;
105105
mp_int_t height = 0;
106-
mp_int_t color_depth = 16;
106+
mp_int_t color_depth = 8;
107107
mp_int_t rotation = 0;
108108

109109
(void)common_hal_os_getenv_int("CIRCUITPY_DISPLAY_WIDTH", &width);
@@ -113,6 +113,9 @@ void picodvi_autoconstruct(void) {
113113

114114
if (height == 0) {
115115
switch (width) {
116+
case 720:
117+
height = 400;
118+
break;
116119
case 640:
117120
height = 480;
118121
break;
@@ -134,7 +137,7 @@ void picodvi_autoconstruct(void) {
134137
// invalid configuration, set back to default
135138
width = default_width;
136139
height = default_height;
137-
color_depth = 16;
140+
color_depth = 8;
138141
}
139142

140143
// construct framebuffer and display

ports/stm/boards/meowbit_v121/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ CIRCUITPY_BITMAPFILTER = 0
2727
CIRCUITPY_BITMAPTOOLS = 0
2828
CIRCUITPY_BLEIO_HCI = 0
2929
CIRCUITPY_EPAPERDISPLAY = 0
30+
CIRCUITPY_FRAMEBUFFERIO = 0
31+
CIRCUITPY_I2CDISPLAYBUS = 0
3032
CIRCUITPY_KEYPAD_DEMUX = 0
3133
CIRCUITPY_SHARPDISPLAY = 0
3234
CIRCUITPY_TILEPALETTEMAPPER = 0

ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ MCU_SERIES = F4
99
MCU_VARIANT = STM32F411xE
1010
MCU_PACKAGE = LQFP100_f4
1111

12+
OPTIMIZATION_FLAGS = -Os
13+
1214
LD_COMMON = boards/common_default.ld
1315
LD_FILE = boards/STM32F411_fs.ld
1416

ports/stm/boards/thunderpack_v11/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ MCU_SERIES = F4
1313
MCU_VARIANT = STM32F411xE
1414
MCU_PACKAGE = UFQFPN48
1515

16+
OPTIMIZATION_FLAGS = -Os
17+
1618
LD_COMMON = boards/common_nvm.ld
1719
LD_FILE = boards/STM32F411_nvm.ld
1820

ports/stm/boards/thunderpack_v12/mpconfigboard.mk

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ MCU_SERIES = F4
2525
MCU_VARIANT = STM32F411xE
2626
MCU_PACKAGE = UFQFPN48
2727

28+
OPTIMIZATION_FLAGS = -Os
29+
2830
LD_COMMON = boards/common_nvm.ld
2931
LD_FILE = boards/STM32F411_nvm_nofs.ld
30-
31-
# Disable TERMINALIO on translations with missing characters.
32-
ifneq (,$(filter $(TRANSLATION),ja ko ru))
33-
CIRCUITPY_TERMINALIO = 0
34-
RELEASE_NEEDS_CLEAN_BUILD = $(CIRCUITPY_DISPLAYIO)
35-
endif

0 commit comments

Comments
 (0)