Smooth Font Overwrite With Background Color #1001
-
Hi, for a project I want to use the smooth font feature of TFT_eSPI which is great, by the way! I put a black rectangle over the region, then write the string. But this looks too flickering. I tried to write the string into a cleared to black sprite and pushed the sprite to the screen, which looks great. But then I have memory issues. So this is also no option. I think a good approach would be that the library writes a rectangle in background color in the size of each character before it prints the character. Is there already such an option available? I tried setTextPadding(), but saw no effect. Any ideas are highly appreciated. Thank you, |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
See the "Font_Demo_x_Array" examples and read the header info as this explains things. The best way to avoid flicker is to use a sprite of the correct size. |
Beta Was this translation helpful? Give feedback.
-
Font_Demo_2_Array demonstrates the use of setTextPadding,(see line 99), you will get flicker if you are not able to use a sprite. |
Beta Was this translation helpful? Give feedback.
-
I realised that my test should have reduced flicker more! I looked at my changed code and spotted an error in the glyph blanking rectangle calculations. This has been corrected and flicker is negligible now. The right hand edge of the last blanking area is tracked so it should handle overlapping font characters. By default this new blanking method will be off for the time being to avoid breaking the RTL code in the TFT_eFEX extension. To turn on flicker reduction use:
I will update the version 2.4.0 beta branch later today and run some more tests. |
Beta Was this translation helpful? Give feedback.
-
The experimental changes have been pushed to the beta branch. This has had limited testing, the functionality will be retained but the implementation may be updated in the near future. Font_Demo_2_Array indicates good flicker reduction and correct blanking. |
Beta Was this translation helpful? Give feedback.
The experimental changes have been pushed to the beta branch. This has had limited testing, the functionality will be retained but the implementation may be updated in the near future. Font_Demo_2_Array indicates good flicker reduction and correct blanking.