Closed rosenhauer closed 1 year ago
Thanks for pointing this out, I'll look at this and try it out for both tcUnicode and native fonts. They both use the same calculation. I have a graphical example that shows this and can try it out.
Many thanks, this somehow escaped through testing, I have fixed this as per your suggestion and it will be in 3.1 which is due very soon.
I had not understood how serious this was, or I would have removed the touch change from 3.1 and released it earlier. As it is now 3.1 is probably a few days from release so it will go into that.
The fix is already applied in - https://github.com/davetcc/tcMenu/blob/master/xmlPlugins/core-display/adaGfxDriver/tcMenuAdaFruitGfx.cpp
You're welcome! Always glad to help out if I can.
On Tue, Jan 24, 2023 at 2:26 AM Dave Cherry @.***> wrote:
I had not understood how serious this was, or I would have removed the touch change from 3.1 and released it earlier. As it is now 3.1 is probably a few days from release so it will go into that.
— Reply to this email directly, view it on GitHub https://github.com/davetcc/tcMenu/issues/276#issuecomment-1401543532, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBTUKA56FX7VIOPNJOSCT3WT6GZ7ANCNFSM6AAAAAATSHZHLA . You are receiving this because you authored the thread.Message ID: @.***>
-- Dave
When using non built in fonts (tested with Adafruit fonts) the offset is incorrectly calculated.
In tcAdaFruitGfx.cpp internalTextExtents function the line:
bl = glyphHeight + pgm_read_byte(&allGlyphs[glIdx].yOffset);
should bebl = glyphHeight + (signed char)pgm_read_byte(&allGlyphs[glIdx].yOffset);
so that negative offsets are calculated correctly. But this still just uses the offset of the last character tested - the left parentheses.or preferably it can be changed by eliminating the bl calculation and replacing
if(baseline) *baseline = bl;
withif(baseline) *baseline = font->yAdvance - height;
This uses the line spacing for the font minus the tallest character.
This is using Arduino 1.8.16 to compile.