Curiosity got the better of me and I had to try this. tl;dr A 96 pixel high font renders quite quickly.
My test rig for RA8875 uses a Pyboard D. I used the font described above, with the following test script. Each time you press "Go" a new random number is displayed in the huge font. Rendering is not instant but it is (in my opinion) acceptably quick. I did not need to use frozen bytecode, but your mileage may vary on a Pyboard 1.1.
Code: Select all
# bignum.py Test/demo of large font for Pyboard RA8875 GUI
# Released under the MIT License (MIT). See LICENSE.
# Copyright (c) 2021 Peter Hinch
from micropython_ra8875.py.ugui import Screen
from micropython_ra8875.py.colors import *
from micropython_ra8875.widgets.label import Label
from micropython_ra8875.widgets.buttons import Button
from micropython_ra8875.fonts import font14
from micropython_ra8875.fonts import numbers # Experimental big font
from micropython_ra8875.driver.tft_local import setup
import urandom
class NumberScreen(Screen):
def __init__(self):
super().__init__()
labels = { 'width' : 300,
'fontcolor' : WHITE,
'border' : 2,
'fgcolor' : RED,
'bgcolor' : (0, 40, 0),
'font' : numbers,
}
self.lbl = Label((5, 5), **labels))
self.btn_quit = Button((390, 240), font = font14, height = 30, width = 80,
fgcolor = RED, shape = RECTANGLE, text = 'Quit',
callback = self.quit)
self.btn_go = Button((5, 240), font = font14, height = 30, width = 80,
fgcolor = RED, shape = RECTANGLE, text = 'Go',
callback = self.go)
def quit(self, _):
Screen.shutdown()
def go(self, _):
lbl.value(str(urandom.getrandbits(16)))
print('Testing TFT...')
setup()
Screen.change(NumberScreen)