[SOLVED] How to format letters as subscript/superscript ?

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

    • [SOLVED] How to format letters as subscript/superscript ?

      Hello everyone,

      I need some subscripted (NO2) and superscripted (m3) characters as text.
      My idea was to create a .c file with the Font Converter (extended, Everson Mono, 20-50 pixels) and just use the generated characters.
      The subscript gamma (0x1D67) works but the subscript 2 or 3 not.
      But why?
      What is the best way to do it?

      Greetings

      The post was edited 2 times, last by MWet123 ().

    • Hi,

      the only way to do this in emWin is by using the super and subscripts Unicode offers.

      To use Unicode with emWin, GUI_UC_SetEncodeUTF8() has to be called. The Unicode characters need to be UTF8 encoded in the string. For example, "subscript 2" (compart.com/en/unicode/U+2082) would be "\xE2\x82\x82" in a C string.

      Lastly, it is also important that the font you are using includes the Unicode characters you want to display.

      Best regards,

      Florian