TTF FONT SIZE problem

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

    • TTF FONT SIZE problem

      Hello,I use emwin V5.48 in Novoton N9H20 MCU with 480x800 LCD.

      Use GUI_TTF_CreateFontAA to create 1 font size.

      It works when the font size is set to 170 or less.

      If the font size exceeds 170, it will not be displayed on the screen.
      - Even if the font size exceeds 170, the return value of the GUI_TTF_CreateFontAA function succeeds.

      What is the largest font size available in TTF?

      Please help me solve the problem.

      example code

      unsigned ttf_aHeight[1] = {170};
      GUI_TTF_CS ttf_aCS[1];
      GUI_FONT ttf_aFont[1];

      ttf_aCS[0].PixelHeight = ttf_aHeight[0];
      ttf_aCS[0].pTTF = &TTF_Data;
      result = GUI_TTF_CreateFontAA(&ttf_aFont[0], &ttf_aCS[0]);

      Thanks a lots
    • Hi,

      you probably ran out of memory. The TTF fonts are created in RAM. The larger the font, the more memory is needed. So, the font size isn't really limited, but obviously your font can't exceed the memory limit.

      Best regards,

      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.
    • Hi
      We run emWin for Nuvoton's N9H20. and try to display Chinese and alphanumeric strings by using TTF font. It is OK for size less than 128. Fail to display the Chinese string for size equal to 128. Alphanumeric characters is OK for size equal to 128.
      We port the code into Windows tool "SimulationTrial", build and run, the Windows result is the same as Nuvoton's N9H20. It does not seems to be the limitation of memory. We doubt it is the limitation of emWin. Do you have the sample code to display Unicode (Chinese, Korean,...) strings ?
      Thanks a lot.

      Ray