Displaying degrees (°) symbol

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

  • Displaying degrees (°) symbol

    Hi to all,
    I'm using Keil uVision 4.72 on STM32F429 ARM processor to develop an emWin application.
    I need to diplay the degrees symbol '°'.
    First I was getting a warning by compiler when using '°', so I enabled UTF8 encoding in compiler preference instead of ansi encoding.
    After warning disappeared I'm still not able to diplay symbol.
    I'm using GUI_Font24B_ASCII font.

    Is this symbol missing in GUI_Font24B_ASCII?
    I have to compile a new font or I'm doing someting wrong anyway?

    Thank you
  • Hi to all again,
    for those who had my same problem I solved it in following way:

    1) enable in compiler UTF8 encoding if using ANSI. (for KEIL MDK is in edit/condfigurations)
    2) select one of the _1 fonts that has extended ASCII table, like GUI_Font16B_1 and not GUI_Font16B_ASCII.
    3) call the GUI_UC_SetEncodeUTF8() else some other characters will appear due to system multi byte encoding of "special" character
    4) call a DrawString function as used to do.

    Hope this helps
  • Hi Adrian,
    Is there something else needed to display the extended ASCII characters (or are they not included in the ST version of the library?) I'm trying to display some with no luck. I've modified the STemWin "Hello World" example program (uses V5.26 library) as follows:


    Source Code

    1. void MainTask(void) {
    2. GUI_Clear();
    3. GUI_SetFont(&GUI_Font20_1);
    4. GUI_UC_SetEncodeUTF8();
    5. GUI_DispString("Halöle");
    6. GUI_DispStringAt("Hal\xc3\xb6le", 0, 20);
    7. //GUI_DispStringAt(hiChars1, 0, 0);
    8. //GUI_DispStringAt(hiChars2, 0, 20);
    9. GUI_DispStringAt(hiChars3, 0, 40);
    10. GUI_DispStringAt(hiChars1, 0, 60);
    11. while(1);
    12. }
    Display All


    (The first 2 lines use UTF-8 and are another subject.)
    The third line displays nothing and the fourth displays the expected text ("uvwxyz{|}~");

    I'd like to use the extended characters as I beliueve that would be simpler than UTF-8. (The first line displays "Halle" indicating the compiler did not like the "ö" and the second line displayed as desired.)

    Thanks!

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

  • Never mind. Displayable characters start at 160. Not obvious from the image on p229. Obvious from Table 10.28 (p 218)

    It would be useful if the character set used for the various fonts was identified in a concrete way.