Hi,
I'm using STM32F769 MCU and emWin to display text with google noto sans ttf font.
Displaying successfully working except some problems; one I posted here before and got answer(Thanks!), and there remain two of them.
1. As I wrote in subject, emWin provides two font-creating APIs regarding TTF; one is GUI_TTF_CreateFontAA() and the other is GUI_TTF_CreateFont().
I tested GUI_TTF_CreateFontAA() on STM32F769I_EVAL board and checked anti-aliasing is working, but with my own board it doesn't seem to work. image 1 in the attatchment is result of using CreateFontAA() and CreateFont() from same font source.
The font used in first line is made from GUI_TTF_CreateFontAA() and the font used in second line is made from GUI_TTF_CreateFont().
I think AA is not working in here, and here's what I thought:
In my board environment, I use ARGB8888 format on frame buffer side; LTDC and emWin is inited with color format ARGB8888 and the date written in frame buffer is also in same format.
However, since my LCD display doesn't support 32 bit format, I convert the display data from LTDC into RGB888 on DSI-Host. (I inited it with color pixel format RGB888).
So if the CreateFontAA() creates anti-aliasing effect by simply changing only the alpha data and leave the RGB, it won't show on my display because data of the alpha channel is lost.
Is it right?
since my board connection is more complicated than I described, current setting of configuration is the only set confirmed to be working, and I'm not sure if display will still working if I change the color pixel format of DSI-Host and afterwards.
So I am wondering if my assumption is right, is there any way I can convert changed alpha data into changed RGB data?
I mean, if those aliased pixels all have RGB block color(0x000000) and different alpha makes them with different color, can I get RGB data of those changed color?
2. I cannot display text with text mode "normal". I displayed the same code with only changing in text mode: changed GUI_SetTextMode(GUI_TM_TRANS); to GUI_SetTextMode(GUI_TM_Normal); and got those results in image 2.
Is it related with the color pixel format problem?
How can I solve these problems?
Anything can be really helpful for me.
Oh and these are the source code I used to get image1 and image 2!
I commented GUI_SetTextMode() and as I said if the normal mode is activated, the result only shows the first character "N" and ignores the rest but no hard fault or error is occured.
The code happily reaches to while(1); loop in the end of the code.
Thanks.
Display All
Thanks in advance.
P.S. I tested http://forum.segger.com/index.php?page=Thread&postID=9063&highlight=anti#post9063 code in here, and the result was not same as it should be: upper-left corner and lower-right corner is displayed everything else is white.
I'm using STM32F769 MCU and emWin to display text with google noto sans ttf font.
Displaying successfully working except some problems; one I posted here before and got answer(Thanks!), and there remain two of them.
1. As I wrote in subject, emWin provides two font-creating APIs regarding TTF; one is GUI_TTF_CreateFontAA() and the other is GUI_TTF_CreateFont().
I tested GUI_TTF_CreateFontAA() on STM32F769I_EVAL board and checked anti-aliasing is working, but with my own board it doesn't seem to work. image 1 in the attatchment is result of using CreateFontAA() and CreateFont() from same font source.
The font used in first line is made from GUI_TTF_CreateFontAA() and the font used in second line is made from GUI_TTF_CreateFont().
I think AA is not working in here, and here's what I thought:
In my board environment, I use ARGB8888 format on frame buffer side; LTDC and emWin is inited with color format ARGB8888 and the date written in frame buffer is also in same format.
However, since my LCD display doesn't support 32 bit format, I convert the display data from LTDC into RGB888 on DSI-Host. (I inited it with color pixel format RGB888).
So if the CreateFontAA() creates anti-aliasing effect by simply changing only the alpha data and leave the RGB, it won't show on my display because data of the alpha channel is lost.
Is it right?
since my board connection is more complicated than I described, current setting of configuration is the only set confirmed to be working, and I'm not sure if display will still working if I change the color pixel format of DSI-Host and afterwards.
So I am wondering if my assumption is right, is there any way I can convert changed alpha data into changed RGB data?
I mean, if those aliased pixels all have RGB block color(0x000000) and different alpha makes them with different color, can I get RGB data of those changed color?
2. I cannot display text with text mode "normal". I displayed the same code with only changing in text mode: changed GUI_SetTextMode(GUI_TM_TRANS); to GUI_SetTextMode(GUI_TM_Normal); and got those results in image 2.
Is it related with the color pixel format problem?
How can I solve these problems?
Anything can be really helpful for me.
Oh and these are the source code I used to get image1 and image 2!
I commented GUI_SetTextMode() and as I said if the normal mode is activated, the result only shows the first character "N" and ignores the rest but no hard fault or error is occured.
The code happily reaches to while(1); loop in the end of the code.
Thanks.
Source Code
- GUI_TTF_DATA NotoSansData;
- GUI_TTF_CS NotoSans48CS; GUI_FONT NotoSans48; GUI_FONT NotoSansNoAA;
- NotoSansData.pData = &_acNotoSans_Regular; NotoSansData.NumBytes = sizeof(_acNotoSans_Regular);
- NotoSans48CS.pTTF = &NotoSansData; NotoSans48CS.PixelHeight = 72; NotoSans48CS.FaceIndex = 0;
- GUI_UC_SetEncodeUTF8(); GUI_TTF_SetCacheSize(1, 1, 100000);
- GUI_TTF_CreateFontAA(&NotoSans48, &NotoSans48CS);
- //GUI_SetTextMode(GUI_TM_NORMAL); GUI_SetTextMode(GUI_TM_TRANS);
- GUI_SetBkColor(0xffffffff); GUI_Clear();
- GUI_SetFont(&NotoSans48);
- DispCharByChar("NotoSans AA \n");
- GUI_TTF_CreateFont(&NotoSansNoAA, &NotoSans48CS);
- GUI_SetFont(&NotoSansNoAA); DispCharByChar("NotoSans noAA \n");
- while(1);
Thanks in advance.
P.S. I tested http://forum.segger.com/index.php?page=Thread&postID=9063&highlight=anti#post9063 code in here, and the result was not same as it should be: upper-left corner and lower-right corner is displayed everything else is white.
The post was edited 3 times, last by mcubebry ().