Overwriting smooth fonts #1826
-
Hi Mr. Bodmer, what an absolutely fantastic library you've made. You're a genius!! Thank-you so much! You must never sleep. I am having some difficulty with some large numbers and text. The text padding works horizontally, but some of my letters and numbers need a padding on top. Code is below and a screenshot so you can see. The "lines" above the number are from previous numbers and text that did not get overwritten when values changed. Any thoughts? I've tried using your new flicker free tft.print function with the setCursor(x,y,true) which works great, no extra detritus at the tops of the letters/numbers, but it seems the tft.print function does not support text datum, and I need this to be centered. Adding a rectangle behind only makes terrible flicker. I've also tried using sprites - which work great, except for a bizarre case where if I use green text color, the numbers and text are pixelated and not anti-aliased...very odd because I have 4 sensor values I'm printing in different colors and the other 3 colors print smoothly - same code, just different color. I don't want to hijack my own thread, so I'll leave that for another day and focus on the issue with the drawString results. So I'm hoping there might be a way to get the drawstring to work as in the example below. Thanks for any help. Code: |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 4 replies
-
I should add, a previous version of the library did not exhibit this behavior. Thanks. |
Beta Was this translation helpful? Give feedback.
-
The library examples do not exhibit the problem so this may be specific to the font you have created. To identify the root cause I need a simple sketch that demonstrates the problem, this must include the font. Incidentally the purpose of setTextPadding() is to avoid the need to pad with spaces. Also using drawNumber with an appropriately set padding width will avoid the need to convert to a string. |
Beta Was this translation helpful? Give feedback.
-
Thank you, I can appreciate that. I will see what I can do to create a simple version for you to test. I made the font using your amazing Processing sketch, and it's Arial Bold at 126 size. I also found some VERY VERY strange results when using the text padding - to the point I had to stop using it. It broke completely unrelated things, and it was only sheer intuition that led me to try disabling it and then normal functionality was restored. I realize this helps you 0%, I'm sorry. But there's definitely some issues with it. Working code with a previous version of your library was what broke after I tried using the text padding. I'll see if I can make something for you to test regarding the numbers. I made a workaround with a small rectangle over the tops of the numbers that isn't noticeable but removes the offending leftovers. Using a previous value and painting it underneath only led to terrible flicker. Again, I can only humbly say thank-you. I'm not sure people realize what a monumental triumph this library is, and your work in general. Hats off! Mike |
Beta Was this translation helpful? Give feedback.
-
I created the attached in an attempt to re-create the problem, however it works fine. Run it and see if you have a problem. The font only has 0-9 in it. If unrelated things get broken then this suggests a memory consumption problem, or running off then end of an array elsewhere in your sketch. |
Beta Was this translation helpful? Give feedback.
-
Glad to here you have a solution. As far as I can tell TFT_eSPI is working correctly. The "Alerts" section is for identifiable problems and solutions so to avoid misunderstanding I have moved the discussion and renamed it. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
No worries! And thank- you so much for letting me know. In my own programming I've come to have immense respect for the complexity that goes into projects like yours. I'm amazed more things didn't break; the new updates are terrific! I did have another little wonder - sometimes when compiling, I get messages about unused variables coming from the TFT library. The messages don't show up every time either. Any thoughts on that? Thanks again. I hope somehow you get paid for all of this monumental effort. Mike |
Beta Was this translation helpful? Give feedback.
Glad to here you have a solution. As far as I can tell TFT_eSPI is working correctly.
The "Alerts" section is for identifiable problems and solutions so to avoid misunderstanding I have moved the discussion and renamed it.