22 views
in Embedded Wizard Studio by
Hello,

I'm currently working on a GUI Project with several screens and 5 different languages. Then I implemented Chinese as language and had to use range.txt files to save as much memory as possible.

In the past I reduced the   #define EW_MAX_GLYPH_SURFACE_WIDTH   and   #define EW_MAX_GLYPH_SURFACE_HEIGHT  to solve memory issues becaus I use a very limited STM32 CPu for the project.

Now since chinese came into the game the loading time of some screens takes much longer than in all the other languages. And this happens only on one screen where the most text is placed.

When I increase the Glyph surface it works well again but I'm worried about my memory space and the errors that come with it.

Can you please explain the working principles of the  Glyph width memory definition and how it works and is used in the backround to render the screens so that i can precisely set my ranges as small as possible to use only as much

memory as needed and not more.

Note: I am using different fontsizes and fontstyles

 

Thanks and best regards,

ahaas

1 Answer

0 votes
by

Hello,

first of all, let me refer to the article Memory Footprint which explains all details of memory consumption and memory footprint reduction.

The macros EW_MAX_GLYPH_SURFACE_WIDTH and EW_MAX_GLYPH_SURFACE_HEIGHT specify the dimension of the glyph cache surface. This surface stores all glyphs used during text drawing operations. The larger the surface the more glyphs can be reused without needing to decompress or rasterize them again. The values for the macros are expressed in pixel as integer numbers lying between 64 and the maximum surface size supported on the graphics hardware. You should ensure, that the glyph surface is at least as large as the biggest glyph you want to display at the runtime. The following quotation can be used to calculate the approximated RAM usage resulting from the configuration of the macros:

( EW_MAX_GLYPH_SURFACE_WIDTH * EW_MAX_GLYPH_SURFACE_HEIGHT ) * 1 Byte.

On the other side - the larger the glyph surface, the better performance can be achieved, because the glyphs are not decompressed or rasterized again and again...

Maybe there are other possibilities to save RAM in your target? Can you share your ewconfig.h file?

Best regards,

Manfred.

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...