Absolutely. I have no appetite for following that route either.Roberthh wrote:...My major point here is, that a small set of fonts always fits into flash, so compressing is hardly a benefit.
The issue of the compiler running out of heap, or needing larger contiguous blocks than it can find, is a curse. I've not yet figured out the best solution - perhaps you already have? What I had in mind was putting the code that won't cross compile (e.g. Viper) into separate modules. Precompiling the stable code either into mpy modules or into flash as frozen bytecode. And putting fonts into frozen bytecode.
The frozen modules and any mpy modules can then be imported without invoking the compiler so hopefully it will have an easier task.
If the Viper is to go into separate modules it would require changes to tft.py to change the functions from static methods to stand-alone functions.
When I was developing the e-paper driver I put my problems down to the buffers required. I've been disappointed to encounter memory issues with your driver which is relatively frugal with RAM. Even with my scheduler and my GUI code the heap usage is under 50% yet I've had errors and occasional crashes just on importing. But at least precompilation and persistent bytecode offer potential solutions.
I'd very much like to hear your thoughts, both on the general problem and on any changes to the tft module you might be considering.