some edits to the demos
authorEduardo <[email protected]>
Sun, 10 Dec 2023 21:58:35 +0000 (22:58 +0100)
committerEduardo <[email protected]>
Sun, 10 Dec 2023 21:58:35 +0000 (22:58 +0100)
ili9341/demo_fonts.py
ili9341/demo_fonts8x8.py

index 20cc89ebb7ede22f8ea21be3a2f4680690aace19..06f107ca6f7930ebffa269452c61f70f360eac7f 100644 (file)
@@ -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,
index a71d57158f5d2bb5e5238fb5d771c611ce4f8709..d520407d8cae452cf5dffb8fd58e7664505c5b85 100644 (file)
@@ -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)