the font cache (more precise the glyph cache) is a preallocated piece of memory that is used to store all uncompressed glyphs within the memory - this means, all glyphs that are requested during runtime in order to draw a text are decompressed and stored within the glyph cache. As long as there is enough space within the glyph cache, all frequently used glyphs are kept within the cache to avoid decompression again and again.
The glyph cache is allocated by the memory manager - in case of STM32 it will be allocated somewhere in the provided memory pool. The size of the glyph cache can be configured by setting the defines EW_MAX_GLYPH_SURFACE_WIDTH and EW_MAX_GLYPH_SURFACE_HEIGHT.
The surface cache is not a preallocated memory - the define EW_MAX_SURFACE_CACHE_SIZE is used to control the number of bytes that can be occupied by bitmap resources that are no more used by the UI application. As long as there is enough memory available, the bitmap resources are still available within the memory in order to avoid further loading and decompression in case they are used again. Just a kind of runtime optimization.
The size of the surface cache can be configured by setting EW_MAX_SURFACE_CACHE_SIZE within your makefile. You can set it to a small value like 100 kByte in order to ensure that small images remain in the memory and only large bitmaps are removed immedialtey if they are no more in use.
The provided memory pool is used for all resources (images, font glyphs, strings) and for all Chora objects. By using the memory profiling feature you can print the memory consumption at runtime.