2023-04-20 07:31 AM - edited 2023-11-20 07:32 AM
Hi community.. I am doing an application to display some text in a display 5 inches..
I am using stm32cubeide and touch gfx..
They are asking me to support the cyrillic and hebrew language.
When i Set the text on the gui and i try to watch it statically it is working..
But when i try to do somethin shown below with the code i see ony question marks ?? in the display...
textArea4.setColor(touchgfx::Color::getColorFrom24BitRGB(236, 209, 18));//extra time?
Unicode::strncpy(textArea4Buffer, parArea4[tipolingua][5], Unicode::strlen(parArea4[tipolingua][5])+1);
textArea4.invalidate();
where parArea4 it is the following and it is giving problems when the language is cyrillic or hebrew..
const char* parArea4[5][6] = {
{ "Preheating",
"Ready",
" ",
"Baking",
"Extra time",
"Extra time?"
},
{ "Preriscaldo",
"Pronto",
" ",
"Cottura",
"Extra time",
"Extra time?"
},
{ "Prechauffage",
"Pret",
" ",
"Cuisson",
"Extra time",
"Extra time?"
},
{ "Предварительный нагрев",
"Готовый",
" ",
"Выпечка",
"дополнительное врем�?",
"дополнительное врем�??"
},
{ "חימו�? מוקד�?",
"מוּכָן",
" ",
"�?ֲפִיָה",
"זמן נוסף",
"זמן נוסף"
}
};
Any idea why about this strange behaviour ?
Thanks a lot
Solved! Go to Solution.
2023-05-09 06:39 AM - edited 2023-11-20 07:33 AM
Hello SGasp.1,
For the range, based on this website the range should be something like this: Ѐ-ԯ (0x0400 to 0x052F)
So you can put this as a wildcard range value (either in letters or the Unicode).
Also, you can't use the Cyrillic letters in your code directly without converting it into Unicode because your C++ code is encoded in UTF-8.
To use them, you can convert your string like this :
void Screen1View::fillText(){
const uint8_t* Mystring = (const uint8_t*)"�?БВГДЕЖЗИ";
Unicode::fromUTF8(Mystring, textArea1Buffer, TEXTAREA1_SIZE);
textArea1.invalidate();
}
/Osman
2023-04-25 11:51 PM - edited 2023-11-20 07:33 AM
Hello @SGasp.1,
Since you are using wildcards in your TextArea, you also need to specify the characters and data you wanna pass to your wildcard. For that, go to TouchGFXDesigner > Texts > Typography, then select the typography you are using for your wildcards and fill the Wildcard Ranges section.
E.g. if I want to pass both latin alphabet letters, and numbers to the wildcard :
I'm not sure that will resolve all the problems, but could be something that you forgot to do.
Hope it helps,
/Yoann
2023-04-26 12:48 AM - edited 2023-11-20 07:33 AM
Hi @yoann KLEIN ..
Thanks for your answer..
My situation is the following for the textArea4
So if i am understanding right i have to check arial_bold_20..
This is my situation
Is it correct ?
Shall I change something here ?
Thanks for the support
2023-04-26 06:11 AM
Hello,
I think that you have to put your cyrillic alphabet "first letter-last letter" in the Wildcard Ranges pane.
You also have to ensure that the font you use (here Arial Bold) supports the characters you want to display.
/Yoann
2023-04-26 06:17 AM
Hi @Yoann KLEIN .. can you make an example about how to put cyrillic alphabet "first letter-last letter" ?
Did you check and can you check also please this post ?
https://community.st.com/s/question/0D53W000007Vy0TSAS/cyrillic-symbos-utf8-and-touchgfx
In any case I have tried to change the first letter last letter in cyrillic but nothing happened.
Thanks a lot
2023-05-09 06:39 AM - edited 2023-11-20 07:33 AM
Hello SGasp.1,
For the range, based on this website the range should be something like this: Ѐ-ԯ (0x0400 to 0x052F)
So you can put this as a wildcard range value (either in letters or the Unicode).
Also, you can't use the Cyrillic letters in your code directly without converting it into Unicode because your C++ code is encoded in UTF-8.
To use them, you can convert your string like this :
void Screen1View::fillText(){
const uint8_t* Mystring = (const uint8_t*)"�?БВГДЕЖЗИ";
Unicode::fromUTF8(Mystring, textArea1Buffer, TEXTAREA1_SIZE);
textArea1.invalidate();
}
/Osman