Text Alignment differences between JUCE 5.4.4 and 5.4.5

I finally updated today from 5.4.4 to 5.4.5. Immediately I noticed a slight difference in text alignment on TextButtons.

(Granted, these are small buttons, but something is off). Zoomed in:

actual size:

juce

You can see the semi-opaque line I drew under the text; in 5.4.5, the text drops by 1 pixel. It’s no longer vertically centered properly.

There are no custom or modified LookAndFeels involved with these buttons; straight old default TextButton.

2 Likes

Which OS is it? Or is it all of them?

Sorry, should have said: Mac OS X Mojave.

I’m having the same issue, and i also didn’t notice it on OSX until 5.4.5. But i remember that i had similar issues on windows also in the past.

I think it is an unlucky combination of text hinting, font size and button size, but the example above shows that the pervious 5.4.4 looks much more centred than the 5.4.5 version.

1 Like

No comment from JUCE developers?

2 Likes

To avoid this kind of regressions, maybe some simple Unit Tests could be added.

They could work like this: create one temporary instance of the Component to test, give it some default bounds and meaningful appearance properties, then take a snapshot of it using the software renderer (thus ruling out any system-dependent variance) and compare it with a known reference image previously taken with the same method.

I’ve fixed an issue with glyph alignment here:

Has this restored the vertical alignment?

I just incorporated the fixes, and sadly, it does not fix the issue. The text is still down 1 pixel, no change.

Here’s a test GUI App with those two little buttons in it, and some positioning code copied from my app. I just tested it with both 5.4.4 and 5.4.5 and the issue is reproducible. Hope that helps!

TestButtonText.zip (5.2 KB)