cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX Button with Label Text position problem

Soner
Associate II

Hi,

When using this, single-character text isn't perfectly centered on the button,
the letter appears slightly higher.
Also, characters like .,_ appear higher than they should.
Is it possible to adjust the text position horizontally when using these?

 

1 REPLY 1
JohanAstrup
ST Employee

Hello @Soner.

The text is displayed according to how the font is defined. For most fonts, there will be a top margin for Latin characters. I have included a screenshot below, where you can clearly see that the text is not vertically centered when used in a text area with auto size enabled, and it is effectively the same that happens when used in a Button With Label widget.

JohanAstrup_0-1776839203829.png

I don’t think there is an easy workaround for this specific widget. However, what you could do - and what I usually do myself - is to use a Flex Button instead. This widget is much more versatile and allows you to manually control the position of the text within the button. That makes it possible to compensate for the top margin above the characters.

I’m also a bit interested in the other issue you mention, where ".,_" appear slightly higher than they should. Could you please clarify what you mean and share a screenshot? I haven’t been able to reproduce it.

Best regards,
Johan