text positioning - device vs sim - screenshot included

I have a lot of text, and the problem is that some of it is sized depending on the screen dimensions, so your module won’t work out of the box. I had an attempt at implementing a fix myself a while back with a baselineShift factor for the y positioning but as you know the problem is cross platform compatibility. I was kind of hoping the the guys at Corona might have fixed this and that I’d just missed the fix.

Was this ever fixed? I am still having this problem with the current daily build. I’m using a custom font and it appears slightly higher on the device than it does in the simulator. I’ve put this off throughout the development of my game (years) but want to address it now because i’m due to publish. Can anyone help?

The font file has some empty space above and below the visible portion of the font to account for superscript and such. The different platforms handles the font differently so that is what you are seeing.

You can handle this manually by putting a bit of an offset on the Y position. You can also try this module I made to get the perfect placement: http://code.coronalabs.com/code/perfect-vertical-text-alignment-across-devices 

Hi jonjonsson. Thanks for suggesting your module, I’ll look into it, though I’ll probably have to change it because I’m still on graphics 1.

I had a thought that this problem might just be in graphics v1 compatibility mode. I haven’t tried migrating to graphics 2.0 because I don’t have time right now, do you know if it makes any difference?

 

Hi Julius. There is no difference between graphics 1 and 2 in regards to this problem. 

The module was originally made for graphics 1 so you can see the changes in the repository. I never tried it in compatibility mode though.

I would say it depends on how much text you have and how nit-picky you are if its a good time investment to use that module though.

I have a lot of text, and the problem is that some of it is sized depending on the screen dimensions, so your module won’t work out of the box. I had an attempt at implementing a fix myself a while back with a baselineShift factor for the y positioning but as you know the problem is cross platform compatibility. I was kind of hoping the the guys at Corona might have fixed this and that I’d just missed the fix.