Does anyone else notice that newText objects are displayed in a different position on iOS?

I’ve found that newText objects which use a custom font are rendered slightly higher than the y position that I set them at. I presume it’s something to do with how iOS itself processes the font, since it doesn’t happen on Android or the simulator (Mac or Win).

Just wondered if anyone else had noticed it, and whether there were any solutions? I end up creating my own newTxt function which just calls newText but moves it down slightly if the platform is iOS. This works fine, but if I accidentally use the regular newText function it can be annoying. [import]uid: 84115 topic_id: 34970 reply_id: 334970[/import]

I’ve definitely noticed format irregularity but not consistently, just depends on the font. If you can prove it’s consistent I would strongly suggest filing a bug. (I’d also check to see behavior on sim vs. on device)

The best way to handle I’ve found to handle replacement functions like that is to just make them local, ie:

local newText = myFunctionFile.newTxt

That way you’d know newText() is your function and display.newText() is Corona’s. (Normally I’d just say overwrite but obviously you need the display version to make yours work)

[import]uid: 41884 topic_id: 34970 reply_id: 139010[/import]

Yup, generally text on an actual iOS device is 2-3 pixels higher than on the Corona Simulator or Android. I have a global variable setup for this which is 0 or 2/3 depending on the environment that I add to every text object’s Y position. [import]uid: 93133 topic_id: 34970 reply_id: 139024[/import]

Yes, we also have this issue… we also use a global variable to determine the offset and in some cases we just moved to using bitmap fonts instead… [import]uid: 80469 topic_id: 34970 reply_id: 139055[/import]

This is a problem that plagues a lot of people. The problem is that OS-X and iOS (and Android for that matter) all render font’s a little bit differently. One of the biggest offenders is if you put a display.newText("",…) on the screen with an empty string, then later changed it to a value with it’s .text property. The text would be way off in that case.

That later case has been fixed with one of the later daily builds.

[import]uid: 199310 topic_id: 34970 reply_id: 139105[/import]

I’ve definitely noticed format irregularity but not consistently, just depends on the font. If you can prove it’s consistent I would strongly suggest filing a bug. (I’d also check to see behavior on sim vs. on device)

The best way to handle I’ve found to handle replacement functions like that is to just make them local, ie:

local newText = myFunctionFile.newTxt

That way you’d know newText() is your function and display.newText() is Corona’s. (Normally I’d just say overwrite but obviously you need the display version to make yours work)

[import]uid: 41884 topic_id: 34970 reply_id: 139010[/import]

Yup, generally text on an actual iOS device is 2-3 pixels higher than on the Corona Simulator or Android. I have a global variable setup for this which is 0 or 2/3 depending on the environment that I add to every text object’s Y position. [import]uid: 93133 topic_id: 34970 reply_id: 139024[/import]

Yes, we also have this issue… we also use a global variable to determine the offset and in some cases we just moved to using bitmap fonts instead… [import]uid: 80469 topic_id: 34970 reply_id: 139055[/import]

This is a problem that plagues a lot of people. The problem is that OS-X and iOS (and Android for that matter) all render font’s a little bit differently. One of the biggest offenders is if you put a display.newText("",…) on the screen with an empty string, then later changed it to a value with it’s .text property. The text would be way off in that case.

That later case has been fixed with one of the later daily builds.

[import]uid: 199310 topic_id: 34970 reply_id: 139105[/import]