You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A few times in the past the desire has come up to be able to support a wider range of languages with Slint on MCUs, without pre-rendering a large amount of glyphs ahead of time or embedding an entire TrueType font in regular flash space (most recently in #4149 ).
We could add a feature among the following lines to address this:
Add a slint/sdcard-fonts feature that enables dependencies to embedded_sdmmc and fat32 (or similar crates)
When this feature is enabled, we also enable dependencies to fontdue or some other rasteriser, and ttf-parser.
Finally, at run-time we could look for the first .ttf file on an SD card (if inserted), read the cmap/hmtx/os2/etc. tables to cache basic font metrics, and then on a per-glyph basis cache glyph metrics and renderered glyphs on the heap on-demand.
On MCUs that are equipped with enough RAM, like an STM32H7 for example, this might be a reasonable solution to better support multiple languages.
In the same context, it might make sense to add the ability to load translations off of the same SD-Card - see also #3715
The text was updated successfully, but these errors were encountered:
We can add such an API, but that won’t make it possible for folks to use their own SD-Card setup, because those aren’t memory mapped. It would have to be something that abstracts away also the I/O.
That said, it’s indeed not enough to have the feature, we need indeed an API that abstracts away at least device access.
I also wonder how to make the ttf parser work on such a device hmm.
And using this API, the dev would be free to use a sdcard driver themselves to load the font at runtime from a SDCard instead of using include_bytes.
In this case, low-memory devices may not be able to load this ttf file. Perhaps we need to abstract some resource access interfaces so that we can randomly read any data source at will.
tronical
changed the title
MCU: Add support for font rendering from TrueType fonts loaded from an SD-Card
MCU: Add support for font rendering from TrueType fonts loaded from an SD-Card or EEProm, etc.
Jan 15, 2024
tronical
changed the title
MCU: Add support for font rendering from TrueType fonts loaded from an SD-Card or EEProm, etc.
MCU: Add support for font rendering from TrueType fonts loaded from memory
Jan 15, 2024
A few times in the past the desire has come up to be able to support a wider range of languages with Slint on MCUs, without pre-rendering a large amount of glyphs ahead of time or embedding an entire TrueType font in regular flash space (most recently in #4149 ).
We could add a feature among the following lines to address this:
slint/sdcard-fonts
feature that enables dependencies to embedded_sdmmc and fat32 (or similar crates).ttf
file on an SD card (if inserted), read the cmap/hmtx/os2/etc. tables to cache basic font metrics, and then on a per-glyph basis cache glyph metrics and renderered glyphs on the heap on-demand.On MCUs that are equipped with enough RAM, like an STM32H7 for example, this might be a reasonable solution to better support multiple languages.
In the same context, it might make sense to add the ability to load translations off of the same SD-Card - see also #3715
The text was updated successfully, but these errors were encountered: