Simulator Layout Broken

I just upgraded from 2546 to 2561 and while the device builds look fine, suddenly my UI layout on the simulator is horribly broken. It looks like all text has been shunted down by about 10 pixels.

For reference I’m on an old 2011 Mac Book Pro, so I wonder if this is to do with the retina changes? Might things be broken for us non-retina plebs?

Hi @tap32,

This may be the reason. For testing, can you right-click on the “Corona Simulator” application item (for build #2561), select “Get Info…”, check the “Run in low resolution” box, and run it again to see if the results differ? If that doesn’t yield any differences, can you post a screenshot which compares 2546 to 2561?

Thanks,

Brent

The Simulator was thoroughly tested on non-Retina machines so I don’t think that’s likely to be the issue.  As mentioned, screenshots would go a long way to helping us understand what you are seeing.  

Another change that might have the effect you are seeing is that fonts in the project folder are now automatically loaded by the Simulator as they are on a device. You can see if this is happening by looking for lines like this in the console:

Feb 19 15:08:19.093: Activated fonts in 'PTN57F\_0.ttf'

Thanks, will try to get some screens up later today. How do I post images in this forum?

Just to be certain, we reran our tests on Retina and non-Retina Macs (and a couple of devices) and got the same results each time which are shown below (the screenshot is from a non-Retina Mac).  If you have a reproducible case, file a bug including the complete project necessary to demonstrate the problem and we’ll take a look.

(you can add images to a post using the “More Reply Options” button when you’re replying)

@Brent, sorry for the delay - I’ve just looked at the Corona App and can’t see a low resolution option
@Perry, just checked the console and there’s no mention of fonts in the output.

Here’s the before and after, 2015.2561 vs 2015.2546. I’m using the BPReplay font which validates fine in FontBook.

Actually, it looks like it’s to do with how the font is handled. Fortunately I’ve coded it so that the font can be changed with the single line. Using the system font and Courier the problems vanish.

I’m guessing that between the two versions the way custom fonts were handled changed in someway?

In case you guys want to have a look, you can find the font here:
http://www.fontsquirrel.com/fonts/BPreplay?q%5Bterm%5D=bpreplay&q%5Bsearch_check%5D=Y

It’s also worth noting that the font is installed on my Mac as an OTF, but for the device I’m using a version converted to TTF by FontSquirrels’ tool. Could it be to do with the difference between OTF and TTF rendering in OS X?

As said, 2546 and the device render the screenshot identically and correctly, 2561 renders it brokenly

We noticed that some third-party fonts (e.g. Open Sans) were not being positioned properly in the OS X Simulator and that has been fixed in Daily Builds 2015.2566 and later.

I’ll try your font in a little bit but I can’t imagine why you’d use an .OTF file on one platform and a .TTF on another.  Use the same on both and your mileage is certain to be less variable.

In case it isn’t clear, with recent Daily Builds you can just put your font in your project directory (.otf or .ttf) and it will automatically be incorporated into your app when you build it (and there’s no need to install the font on your Mac to use it in your app in the Simulator).

Thanks, and that’s a useful feature to have with the simulator. Will try with the new daily build tomorrow. Presumably the custom font guide needs updating though?

Thanks, just to confirm the issue is fixed in 2015.2576

Hi @tap32,

This may be the reason. For testing, can you right-click on the “Corona Simulator” application item (for build #2561), select “Get Info…”, check the “Run in low resolution” box, and run it again to see if the results differ? If that doesn’t yield any differences, can you post a screenshot which compares 2546 to 2561?

Thanks,

Brent

The Simulator was thoroughly tested on non-Retina machines so I don’t think that’s likely to be the issue.  As mentioned, screenshots would go a long way to helping us understand what you are seeing.  

Another change that might have the effect you are seeing is that fonts in the project folder are now automatically loaded by the Simulator as they are on a device. You can see if this is happening by looking for lines like this in the console:

Feb 19 15:08:19.093: Activated fonts in 'PTN57F\_0.ttf'

Thanks, will try to get some screens up later today. How do I post images in this forum?

Just to be certain, we reran our tests on Retina and non-Retina Macs (and a couple of devices) and got the same results each time which are shown below (the screenshot is from a non-Retina Mac).  If you have a reproducible case, file a bug including the complete project necessary to demonstrate the problem and we’ll take a look.

(you can add images to a post using the “More Reply Options” button when you’re replying)

@Brent, sorry for the delay - I’ve just looked at the Corona App and can’t see a low resolution option
@Perry, just checked the console and there’s no mention of fonts in the output.

Here’s the before and after, 2015.2561 vs 2015.2546. I’m using the BPReplay font which validates fine in FontBook.

Actually, it looks like it’s to do with how the font is handled. Fortunately I’ve coded it so that the font can be changed with the single line. Using the system font and Courier the problems vanish.

I’m guessing that between the two versions the way custom fonts were handled changed in someway?

In case you guys want to have a look, you can find the font here:
http://www.fontsquirrel.com/fonts/BPreplay?q%5Bterm%5D=bpreplay&q%5Bsearch_check%5D=Y

It’s also worth noting that the font is installed on my Mac as an OTF, but for the device I’m using a version converted to TTF by FontSquirrels’ tool. Could it be to do with the difference between OTF and TTF rendering in OS X?

As said, 2546 and the device render the screenshot identically and correctly, 2561 renders it brokenly

We noticed that some third-party fonts (e.g. Open Sans) were not being positioned properly in the OS X Simulator and that has been fixed in Daily Builds 2015.2566 and later.

I’ll try your font in a little bit but I can’t imagine why you’d use an .OTF file on one platform and a .TTF on another.  Use the same on both and your mileage is certain to be less variable.