showing special characters #1664
Replies: 1 comment
-
The Free Font format was created by Adafruit and I adopted it and included their font files to provide compatibility with Adafruit_GFX. The fonts only contain characters up to 0x7E, see here. Adafruit also provided a font file generation tool, but this needed to be compiled under Linux and had to be modified to generate any codes over 127. A modified pre-compiled copy of that tool is here if you are a windows user. It is a command line tool and there are tutorials on Youtube on how to use it, you may also find info on the Adafruit website. There is a complication, by default TFT_eSPI supports international glyphs in the 16 bit Unicode set. To access these the text string must be in UTF-8 format, more info here. The UTF-8 format uses most of the character codes in the range 128-255 to encode the Unicode value, this means that characters are moved to higher 16 bit Unicode code points. The good news is that TFT_eSPI allows the UTF-8 decoding to be turned off so characters in the range 128 to 255 become available. However you will have to generate new custom fonts. There are also online tools that generate fonts for you via a web page, however some of these will not generate codes above 127. One option is to use smooth (anti-aliased) fonts as you can then include any 16 bit unicode. The library includes a "Processing" tool to produce these fonts. If you only want arrows then further options are to generate small images and render them to the screen or use drawLine. That maybe a lot to digest, so once you decide on an approach I should be able to point you at further resources and information. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
i am actually using the FSSB fonts.
within the messages i write to the display, i should also show "arrow up", "arrow down" and "degree" signs.
for "arrow up" ascii character 94 would be ok.
for "degree" i would like to use character 248, but when using the FSSB font, it looks like no characters above 127 are shown.
and for the "arrow down", there seems to be no ascii character at all.
what's the easiest way to work around these issues?
Beta Was this translation helpful? Give feedback.
All reactions