drawChar() function with loaded font #1197
Unanswered
laci222
asked this question in
Q&A - Fonts
Replies: 1 comment 1 reply
-
drawChar is not supported for smooth fonts. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Bodmer and other experts,
I want to print non-English alphabet characters like Á, É, Ű to the screen. I don't have them in a String variable, but in unicode codepoint format in uint16_t (like uint16_t = 0x00C1 is Á). In reality, I have an array of these characters. Do you know any way how can I convert them to either String or a char array (according to this site it is possible to store these characters in a char array: https://playground.arduino.cc/Code/UTF-8/ char good[] = "5µA"; // Good, and also this library has a Unicode_test example in string format) Also the print functions work with codepoint formats like this: tft.println("\u00C1"); // Á but I don't know if I can convert a uint16_t to this format.
As I had no luck converting them, I found the drawChar(uint16_t uniCode, int32_t x, int32_t y) function. This function can draw a Unicode glyph onto the screen. This accepts my characters and tries to print them, but the default font set does not contain the characters, so they are not shown properly. I converted a font to .vlw format and the to binary and loaded them, but this function still tries to use the original default font.
This is the part of the code, where I try to use the special font:
The strFormat string is displayed properly, as it uses the loaded ArielMT_12 font and the special characters are great too.
But the characters that were displayed with the drawChar() function uses the default font (with TextSize 3) and the special characters are not displayed, only the ASCII ones.
Can you please help, how to make this function use the loaded font set, or how to convert the codepoint format to String or to basic char array?
Beta Was this translation helpful? Give feedback.
All reactions