GUI_DispStringAt not displaying part of text

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

    • GUI_DispStringAt not displaying part of text

      I am trying to display temperaure values in °C on a child window. Calling the following function inside WM_PAINT (in child window callback). But only number is displayed. The intended unit (°C) is not being displayed. What might be the reason?


      void ShowGTemperaure(uint8_t temperature)
      {
      char str[10];
      snprintf(str, sizeof(str), "%u", temperature);
      strcat(str, " ");
      strcat(str, °C);
      GUI_SetFont(FONT_10);
      GUI_SetColor(LIGHT_GREY);
      GUI_DispStringAt(str, 10, 0);
      strcpy(str, "0");
      strcat(str, " ");
      strcat(str, °C);
      GUI_DispStringAt(str, 10, 75);
      }
    • Hello,

      what is your FONT_10? Is this a custom font created in Font Converter or standart font from emWin package? Whether the symbol '°' (ascii code 0xB0) and other symbols you tried to display contained in this font? Can you provide more source code regarding the font and windows created and using this font in WM_PAINT?


      Alex.
    • FONT_10 is custom font generated using emwin FontConv. (Tahoma of size 10).
      I tried displaying it on parent window, its working. But on child window I am not able to display any kinda of alphabets. Only digits can be displayed!!
    • I found the mistakes!!!
      There were two rookie mistakes .
      1. in FONT_10 alphabets were not enabled .
      2. GUI_UC_SetEncodeUTF8() was used in the main function. (should not be set for displaying °C)


      Once I enabled all the letters in Font conv, and started using the .c file in my project the problem solved!