richmond62 wrote: ↑Fri Sep 15, 2023 6:11 pmWhat is all the 'guff' about centered text?
...
142 = (half the height of the field) + (half the size of the text)= (256/2) + (28/2)
@Jacque, @RIchmond: Can I point out an issue with using textHeight? It changes the size of the cursor which can make it look ridiculous.
To test, I used Richmond's algorithm (which I think is similar to what Jacque is proposing):
Code: Select all
set the fixedLineHeight of field 1 to true
set the textHeight of field 1 to the height of field 1/2 + the textSize of field 1/2
The method proposed by Bernd that adjusts the topMargin instead (the algorithm is posted above) does not change the cursor size and produces the expected result. This automates what Craig and Klaus were suggesting as a manual adjustment: Everyone will use what they are conformable with, but for me, I cannot have text boxes where the cursor can be several times the size of the text... so I'd go with Bernd's advice.