Skip to main content
Dadigno
Associate III
June 17, 2024
Question

Cache all fonts at startup

  • June 17, 2024
  • 1 reply
  • 1298 views

Hi Community,

Is it possible to cache all fonts at the startup of TouchGFX in order to have a single memory access?

The documentation provides an example of caching a single font associated with a text box when a screen starts.  If I understand correctly, this procedure would have to be applied to each screen change and for each text box contained each time.

It would be more useful ( for me ) to have a function like "void Bitmap::cacheAll()" for images.

e.g. "void Font::cacheAll()" to be called in FrontendApplication::FrontandApplication().

 

Regards

 

1 reply

ST Employee
June 25, 2024

Hello @Dadigno,

Yes you can put the code anywhere you what, and create all the cached font at in the FrontendApplication, but if you want to use all font then you'll have a large cache, so you also directly use non-cached font in that case.

Regards,

Dadigno
DadignoAuthor
Associate III
June 25, 2024

Hi @LouisB ,


Thanks for your support. Could you please provide an example of how to do what you described? I'm not sure which APIs I should use to cache all the fonts.

 

Regards,

MM..1
Chief III
June 25, 2024