Hi,
I'm using STemWin to display multi-language font(Google Noto Sans), and Everything is working except that sometimes whole sentence is not displayed.
For example, if I want to display "In another moment \n", sometimes the LCD only shows "in another mom".
It seems line-based problem and always the end of sentence(right-end) is skipped.
I'm using GUI_TTF engine and suspecting that when GUI_TTF_CreateFont() (or GUI_TTF_CreateFontAA()) is called, it doesn't get the width information of each character.
I've been testing different fonts, different boards(including STM32F769I-EVAL and custom board), and different strings, different display locations, different emWin APIs(GUI_DispString / GUI_DispStringAt....)
but this problem won't seem to go away.
Here's some solutions I've been discovered:
1. When display string, separating the whole sentence char by char solves the problem.
Here's the API I wrote to do this:
Display All
2. If I input long blank at the end of the string like "In another moment " solves the problem.
What I want to do is to use variety of String Display APIs STemWin offers!
Thanks for your help in advance!
Regards,
Boram
I'm using STemWin to display multi-language font(Google Noto Sans), and Everything is working except that sometimes whole sentence is not displayed.
For example, if I want to display "In another moment \n", sometimes the LCD only shows "in another mom".
It seems line-based problem and always the end of sentence(right-end) is skipped.
I'm using GUI_TTF engine and suspecting that when GUI_TTF_CreateFont() (or GUI_TTF_CreateFontAA()) is called, it doesn't get the width information of each character.
I've been testing different fonts, different boards(including STM32F769I-EVAL and custom board), and different strings, different display locations, different emWin APIs(GUI_DispString / GUI_DispStringAt....)
but this problem won't seem to go away.
Here's some solutions I've been discovered:
1. When display string, separating the whole sentence char by char solves the problem.
Here's the API I wrote to do this:
C Source Code
- void DispCharByChar(char * string)
- {
- char *pstr, pdest[4], octet;
- int size, numbyte, strlength;
- pstr = string;
- size = GUI_UC_GetCharSize(pstr);
- for (; *string; ++string)
- {
- if ((*string & 0xC0) != 0x80)
- {
- ++strlength;
- }
- }
- while(strlength)
- {
- for(numbyte = 0; numbyte < size; numbyte++)
- {
- octet = *(pstr + numbyte);
- pdest[numbyte] = octet;
- }
- pdest[numbyte] = 0; //insert null character to end the single-character string
- GUI_UC_SetEncodeUTF8();
- GUI_DispString(pdest);
- pstr += size;
- size = GUI_UC_GetCharSize(pstr);
- strlength--;
- }
- }
2. If I input long blank at the end of the string like "In another moment " solves the problem.
What I want to do is to use variety of String Display APIs STemWin offers!
Thanks for your help in advance!
Regards,
Boram
The post was edited 3 times, last by mcubebry ().