spr.drawString jiggles around when displaying Strings with EVEN amount of digits but not ODD #3869
Unanswered
dentaku-web
asked this question in
Q&A - Fonts
Replies: 1 comment
-
|
Well, I seem to have figured it out. For some reason I thought spr.drawNumber didn't work while using this type of font so I switched to spr.drawString but it turns out it DOES work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've noticed that when I use spr.setTextDatum(MC_DATUM);
then do something like this in my loop, where int32_t num1 is the value of a rotary encoder and he font is consolab24.vlw stored in Flash using LittleFS
spr.drawString(String(num1), 32, 32);
The numbers will stay still just fine when I'm displaying 0 through 9 but once I get into 2 digit numbers they jiggle left and right as the second digit pushes the first one around. I'm assuming they're trying to stay centred according to how MC_DATUM works.
In fact, any String with any EVEN number of digits does this but ODD numbers of digits don't jiggle.
Using ML_DATUM and shifting the x position a gives me perfectly stable results as the number changes but of course I want to use MC_DATUM.
Previously I was using spr.drawNumber with "consolab12pt7b.h" where MC_DATUM was solid and the characters stayed in place but I wanted to know how much better it would look using .vlw fonts.
Beta Was this translation helpful? Give feedback.
All reactions