This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Starterware/TM4C129XNCZAD: Tiva Font Character mix up

Part Number: TM4C129XNCZAD

Tool/software: Starterware

Some of the fonts that come with the TIva Graphics library do not show characters correctly. One example is '>' gets replaced by '¿'. This only happens when using Cmss and Cm fonts. The g_psFontCmtt46 shows this character correctly. Debugging shows that '<' is correctly represented as the ASCII code 62.

  • < > \ _ { | } are also something else in the Cmss and Cm (but correct in Cmtt fonts).
  • Hi Peter,

    The '¿' has the ascii code of 168. For the same ">" do you see different character being displayed in CM and CMSS fonts or both displayed as '¿'? Is it only a problem when in certain font point size(s) or all sizes?

    I think unless you must use the sans serif and computer modern fonts I will suggest you use the cmtt (typewriter) font or others like cmsc which do not exhibit the problem if it is acceptable to you. In the meantime I will do additional research.
  • Hi Charles,

    46 point font was used to discover this issue. I alternated between g_psFontCmtt46, g_psFontCm46, and g_psFontCmss46. The rest of the firmware was left alone, so the same character was making > or ¿ depending on the font. I also hit a breakpoint and looked as the string array. The character was confirmed to be ASCII code 62.

    As further proof, I drew by hand the character from the C array and got ¿. 

    As a workaround, I edited the font C array g_sFontCmss46. I had to replace element 1570 through 1622 with
    52, 17,
    0, 29,0x62,0xF4,0xD6,0xD6,0xD6,0xD6,0xD6,0xD4,0xB6,0x96,
    0x96,0x96,0x96,0xB4,0xD2,0xF0,0x10,0x10,0x10,0x10,0x10,0x10,
    0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
    0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
    0x10,0x10,

    This workaround took hours to draw and figure out, and I would have to do it all over again if I changed font size. Your fonts are auto generated. Could you look into why > is replaced by ¿ and re-generate those other font sizes for me?

    I do not find the cmtt font visually appealing.

    This font array only has 95 characters. I do not think it extends to ascii code 168

  • Hi Peter,
    Thanks for sharing the workaround. I think you are ahead of us on the solution. Do you see the same problem with cmss46b and cmss46i for the same size. How about different sizes such as cmss44 or cmss48? Is it possible for you only on those special characters to use cmtt46 for which you mentioned was working, at the rest continues with cmss46. The reason I'm suggesting the workarounds (if they are acceptable to you) is because currently we don't have any schedule to release the graphic library again.
  • Could you share the scripts you used to generate the fonts?
  • Hi Peter,
    Please find under C:\ti\TivaWare_C_Series-2.1.4.178\tools\bin\ftrasterize.exe to generate the fonts. The source code and readme is under \C:\ti\TivaWare_C_Series-2.1.4.178\tools\ftrasterize.