-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
extmod/modframebuf: FrameBuffer text scaling #6263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
extmod/modframebuf: FrameBuffer text scaling #6263
Conversation
Ugh. qemu-arm port build and tests failing:
Trigraphs? Seriously? The 1970s are calling and they want to force us to accommodate their crazy keyboards. Will alter test to not generate output that contains repeated question marks... |
Made this patch more flexible by switching to specifying the font size (in pixels) instead of an integer scaling factor. This both allows for drawing text at effective non-integer scales, but also means that a future version could select an alternative built-in font for drawing larger text. Drawing text will be slightly slower with this version due to increased bit twiddling and less scope for short-cutting out of the Y loop. |
9922ca1
to
8c976c6
Compare
8c976c6
to
6274b2a
Compare
6274b2a
to
92914ff
Compare
Related PR: #3583 Simple font size scaling for framebuf |
92914ff
to
8d1743e
Compare
8d1743e
to
77a455f
Compare
77a455f
to
3e84862
Compare
3e84862
to
dccd690
Compare
dccd690
to
7bcd5fd
Compare
7bcd5fd
to
459455c
Compare
459455c
to
4499d80
Compare
4499d80
to
ed996ea
Compare
How is this PR coming along? We love the idea of increasing accessibility and usability for small displays. If we're taking votes, I'd vote for a keyword As an aside, we've received interest in our forums (thread) at Core Electronics for variable font sizes. |
At the moment this PR doesn't seem to have generated sufficient interest to get mainline attention. Since I always build my own MicroPython these days, I just roll this patch into my production branch; so I'm committed to continuing to support it for the foreseeable future. |
ed996ea
to
1282929
Compare
+1 to see this implemented. Great work @jonathanhogg and hopefully @dpgeorge can assist, |
1282929
to
41ab1fc
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6263 +/- ##
=======================================
Coverage 98.57% 98.57%
=======================================
Files 164 164
Lines 21345 21349 +4
=======================================
+ Hits 21040 21044 +4
Misses 305 305 ☔ View full report in Codecov by Sentry. |
See also #8987. It would be good to see some updates to |
9b56b04
to
dfa84e3
Compare
Rebased to 4903e48 and fixed for renamed function argument. |
This is a "Good Idea". +1 from me :) |
dfa84e3
to
e12f089
Compare
Code size report:
|
e12f089
to
993b6b9
Compare
993b6b9
to
2e46ddb
Compare
2e46ddb
to
7b4236e
Compare
Any news on whether the sizing feature is going to be present in the upcoming micropython version? |
7b4236e
to
0718447
Compare
0718447
to
98d5e68
Compare
This is an automated heads-up that we've just merged a Pull Request See #13763 A search suggests this PR might apply the STATIC macro to some C code. If it Although this is an automated message, feel free to @-reply to me directly if |
98d5e68
to
5652e42
Compare
Add a `size` parameter to the `text()` method. This does a fairly simple scaling of the built-in 8 pixel font for the moment, but could use different fonts in the future.
Document new optional size parameter for the text method.
5652e42
to
f8d2ace
Compare
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)