← index #7384PR #6263
Duplicate · high · value 2.528
QUERY · ISSUE

framebuf: Support drawing text at different sizes

openby jonathanhoggopened 2021-06-12updated 2026-03-24
extmod

I'm increasingly making little widgets with MicroPython that use small OLED displays to present information to the user. The text support in FrameBuffer() is great, but it's limited to the built-in 8-pixel-square font. Being able to display text at different sizes makes a massive usability difference.

I've already written a patch that does simple arbitrary scaling of the built-in font and raised PR #6263. I've been using this in production devices for a year now, but supporting a bunch of patches is becoming a bore and I hate not being able to use the official releases so I'd like to get this PR mainlined as-is or some feedback on what I could change to get it accepted.

Thought that perhaps opening an issue might raise the visibility of this.

CANDIDATE · PULL REQUEST

extmod/modframebuf: FrameBuffer text scaling

openby jonathanhoggopened 2020-07-20updated 2024-10-29
extmod

This adds the ability to scale-up the standard 8x8 font when drawing text. This is useful with tiny OLED screens (such as on the Heltec WiFi Kit 32) where you need to display something important a bit more clearly. This does not provide any new, larger fonts so the text will look increasingly blocky as it is scaled.

I'm not wedded to the additional positional argument here – it was just simplest and matched the way color is provided. I'm happy to go back and switch this to being a keyword optional argument instead.

(Fixes #7384)

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied