From 4fcdb5dd8d07b75b0d3d405d15f463aa44ef9e0f Mon Sep 17 00:00:00 2001 From: Eduardo Date: Sun, 10 Dec 2023 22:58:35 +0100 Subject: [PATCH] some edits to the demos --- ili9341/demo_fonts.py | 32 ++++++++++++++++++++------------ ili9341/demo_fonts8x8.py | 2 +- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ili9341/demo_fonts.py b/ili9341/demo_fonts.py index 20cc89e..06f107c 100644 --- a/ili9341/demo_fonts.py +++ b/ili9341/demo_fonts.py @@ -1,8 +1,8 @@ """ILI9341 demo (fonts).""" from time import sleep -from ili9341 import Display, color565 +from ili9341.ili9341 import Display, color565 from machine import Pin, SPI -from xglcd_font import XglcdFont +from ili9341.xglcd_font import XglcdFont TFT_CLK_PIN = const(18) TFT_MOSI_PIN = const(19) @@ -26,23 +26,27 @@ def test(): print('Loading fonts...') print('Loading arcadepix') - arcadepix = XglcdFont('fonts/ArcadePix9x11.c', 9, 11) + arcadepix = XglcdFont('ili9341/fonts/ArcadePix9x11.c', 9, 11) print('Loading bally') - bally = XglcdFont('fonts/Bally7x9.c', 7, 9) + bally = XglcdFont('ili9341/fonts/Bally7x9.c', 7, 9) print('Loading broadway') - broadway = XglcdFont('fonts/Broadway17x15.c', 17, 15) + broadway = XglcdFont(path='ili9341/fonts/Broadway17x15.c', 17, 15) print('Loading espresso_dolce') - espresso_dolce = XglcdFont('fonts/EspressoDolce18x24.c', 18, 24) + espresso_dolce = XglcdFont('ili9341/fonts/EspressoDolce18x24.c', 18, 24) print('Loading fixed_font') - fixed_font = XglcdFont('fonts/FixedFont5x8.c', 5, 8) + fixed_font = XglcdFont('ili9341/fonts/FixedFont5x8.c', 5, 8) print('Loading neato') - neato = XglcdFont('fonts/Neato5x7.c', 5, 7, letter_count=223) + neato = XglcdFont('ili9341/fonts/Neato5x7.c', 5, 7, letter_count=223) print('Loading robotron') - robotron = XglcdFont('fonts/Robotron13x21.c', 13, 21) + robotron = XglcdFont('ili9341/fonts/Robotron13x21.c', 13, 21) print('Loading unispace') - unispace = XglcdFont('fonts/Unispace12x24.c', 12, 24) + unispace = XglcdFont('ili9341/fonts/Unispace12x24.c', 12, 24) print('Loading wendy') - wendy = XglcdFont('fonts/Wendy7x8.c', 7, 8) + wendy = XglcdFont('ili9341/fonts/Wendy7x8.c', 7, 8) + print('Loading IBM Plex') + ibmplex = XglcdFont('ili9341/fonts/IBMPlexMono12x24.c', 12, 24) + print('Loading Ubuntu') + ubuntu = XglcdFont('ili9341/fonts/UbuntuMono12x24.c', 12, 24) print('Fonts loaded.') display.draw_text(0, 0, 'Arcade Pix 9x11', arcadepix, color565(255, 0, 0)) @@ -58,8 +62,12 @@ def test(): display.draw_text(0, 190, 'Unispace 12x24', unispace, color565(255, 128, 0)) display.draw_text(0, 220, 'Wendy 7x8', wendy, color565(255, 0, 128)) + display.draw_text(0, 240, 'IBMPlexMono 12x24', ibmplex, + color565(255, 128, 60)) + display.draw_text(0, 270, 'UbuntuMono 12x24', ubuntu, + color565(255, 108, 10)) - sleep(9) + sleep(90) display.clear() display.draw_text(0, 255, 'Arcade Pix 9x11', arcadepix, diff --git a/ili9341/demo_fonts8x8.py b/ili9341/demo_fonts8x8.py index a71d571..d520407 100644 --- a/ili9341/demo_fonts8x8.py +++ b/ili9341/demo_fonts8x8.py @@ -1,6 +1,6 @@ """ILI9341 demo (fonts 8x8).""" from time import sleep -from ili9341 import Display, color565 +from ili9341.ili9341 import Display, color565 from machine import Pin, SPI # type: ignore TFT_CLK_PIN = const(18) -- 2.30.2