Font creation using Low RAM application

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Font creation using Low RAM application

      Hi Guys,

      I am working on an old Microcontroller in which I have embedded the Emwin Library.
      But MC(MK22FN512VDC12) has only 128K RAM, so I also have to create multiple fonts.

      Is there any provision available in emwin using that I can access the font even using Lower RAM it can be crated.
      I am mainly targeting the SIF or XBF format. In that, I have to use only a single buffer in RAM(Local) of the maximum size of font size. So I can use a buffer and read font data in it from External Memory which is of (1 MB) and can use the same Single RAM buffer for all fonts.

      Is it possible? If yes then please share an example if any.

      Thanks,
      Amol
    • Hi Anthony,

      Thanks for your response.
      I have tried the above suggestion but,

      In my application, If I store the font data in External Flash then to access that data I have to give space in RAM to read it as External Memory is not Memory-mapped. In any case, I have to read the whole font data in RAM, and then I can use it for font creation.

      So Is there any method in which the overall Font data size is lower than XBF In which I can store the data in Ext Flash and a single buffer in RAM can crate multiple fonts? or is there any other suggestion?

      Note: Due to the 128k RAM size limitation I have to use a single buffer to create a multiple font. Once I create a font I will clear the buffer and proceed to the second font like wise.

      Regards,
      Amol
    • Hello,

      even if the font you generated is a C-file and it is located in addressable memory, emWin font engine still reads the font characters data from flash as they defined with as "const" in C-file. Of course if you do not use tricky things with your compiler. Using RAM memory is minimized.

      Maybe I'm missing something but in your case you also don't need to read the whole font data in RAM from your ext flash even if it is not memory mapped.

      Just for this case you can use GetData function where you can read the font data from your non-addressable flash in small portions into the same buffer in RAM and pass that buffer to emWin. And then emWin would do all the rest job... You don't need to trick with a single buffer for largest font in RAM etc...

      128K of RAM memory is pretty enough for this to work properly. Even for multiple fonts.
      Regards,

      Anthony

      The post was edited 1 time, last by cilmagemlu ().