stb icon indicating copy to clipboard operation
stb copied to clipboard

stb TrueType engine working in low memory environments (like IoT MCUs)

Open codewitch-honey-crisis opened this issue 1 year ago • 0 comments

I'd like to work with the TTF engine on platforms with less RAM than the TTF file is in size.

This header assumes gobs of memory, because it's geared for gaming, which is great, but this library has been incredibly beneficial for me for IoT MCUs like SAMD and ESP32 gear (think Arduino for example).

The thing about this library, is it's very easy to adapt to such an environment, and keep it optimized for gaming while also conditionally allowing for IOT usage.

Here's what I've done in absence of this feature

I modified and adapted this library to stream. It was surprisingly easy. In addition I modified the heap allocation scheme so it didn't assume gobs of RAM, and fell back when it couldn't allocate a lot the first time (a bit less performant in that case, but better than failing)

Additional context

I'd be willing to create a pull request containing this header with conditional compilation for IoT devices. It would I think benefit us all, because I don't really want to keep backporting changes as you improve the library :), and your library becomes more useful in more places.

I just wanted to know if you'd be interested.

codewitch-honey-crisis avatar Sep 11 '22 17:09 codewitch-honey-crisis