[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
      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.