-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
chore(color): Reduce font FLASH storage. #3881
Conversation
The main downside is that it is slower to draw, but maybe it's not that bad. Possibly this can be enabled only for the bigger fonts? |
Do you know which has more impact on performance - RLE compression or bit depth? |
Probably bit depth, but I did not try it out. |
Unfortunately RLE compression slows down text rendering a lot. Should have tested this, thanks for the heads up. Back to the drawing board. |
Attempt 2. STD, BOLD, XS and XXS fonts reverted to original settings. The difference is not noticeable to me on the TX16S screen. Space saving on TX16S:
I've also removed a bunch of unused font files. |
The larger fonts look a bit rougher at the edges, but I do not think that that is an issue. |
Yes, because it would too much flash memory |
Is the XXL font actually used by anything? |
Ins't it accessible to LUA ? |
That's it. I had it removed at first, but then folks started to complain because of the Battery/Timer LUA widget using the font. |
Maybe then XXL should have numbers and special chars only |
Version 3. This removes the L, XL and XXL fonts from the firmware and loads them from SD card files instead. Benefits:
|
Storing fonts on the SD card might open up the possibility of having all languages built into the firmware. If we move all but a basic STD font out of the firmware there might be room for all the language translation strings. |
🤣 Damn you! I had literally just written a comment saying that IMO this was looking to be opening the door up to a long-term goal of having all the translations on the SD card - i.e. single language firmware. i.e. yes, keep just one core font in the firmware to guarantee the ability to show text on screen if the SD content is missing for any reason, and then everything else is on the SD. Were you looking over my shoulder or ears burning just then? 🤣 🤣 |
Great minds think alike :) |
This is something Raphael and I were already planning a few months ago. We should start to write down those ideas somewhere. |
Indeed... the Projects tab would be an excellent place to start... one of these days🤭 |
I should add that this was before @philmoz was as involved as he is now, so there were less people wotking on this kind of changes. |
This is looking really good on TX16S just for EN (~93k reduction in FLASH usage), let alone a more complex symbol set like CN...
with negligible increase in SRAM usage. Will be poking and prodding tomorrow. |
One thing this might affect is the EM display. As the XL font won't be in FLASH it may fall back to the STD font size. Have not tested this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It falls back to STD font size. Generally, this seems to work just fine. Obviously not going to get the larger fonts if the FONTS folder is missing. Yappu Telemetry and iNav Lua widgets and scripts were working just fine with this on TX16S. As far as I'm concerned, the tradeoff of 100kb vs EM screen large print is worth it...
However, I'd like @raphaelcoeffic and/or @gagarinlg's second opinions.
Would be probably better to test it ;-) You should be able to setup a custom function that triggers EM (basically an empty endless loop that triggers the watchdog). |
lol... I did that... that's why I said
😛 |
… Remove unused files.
5d01588
to
db9b639
Compare
Added RU. Updated FONTS.zip file - contents must be in the FONTS folder on the SD card. |
Barring any voices of dissent, this will be merged tonight. Thank you for the updated fonts folder :) |
Support files for EdgeTX/edgetx#3881
Fonts are in the SD card repo now. |
@pfeerick @raphaelcoeffic @philmoz - Any consideration regarding DA ? |
What considerations are you concerned about? Are there any issues? |
no issues, don't fully understand the compression, maybe same to be done for other languages, like DA. |
I tried compression of the fonts initially to save space; but it was too slow. |
Enabling RLE compression and reducing the font to 3 BPP (from 4 BPP) saves a chunk of FLASH.
For EN it saves 39096 bytes.
For TW it saves 143144 bytes.
I don't think there is any noticeable degradation in quality.
EN - current font:
EN - 3 BPP font:
TW - current font:
TW - 3 BPP font: