[Fixed in build #1177] Android 4.3: Broken text

Corona SDK: 2013.1172

Device: Nexus 7

Android version: 4.3

After updating my Nexus 7 to Android 4.3 display.newText renders broken text 

See attached screenshot from sample app.

 

(works fine on previous Android versions/iOS and Corona Simulator)

 

Bug Report filed: Case number 25233

Thanks for the bug report.  We will get the engineers to look at this.  Now do I update my Nexus 7??

Apart the these text problems I haven’t seen any other issues.

I’m assuming this is a quirk with Android 4.3 which will manifest itself on other 4.3 devices as well, but I don’t have access to other Android devices that can be upgraded.

+1

have the same problem with android 4.3 nexus 7 device after update. 

+1

After some investigation, we’ve discovered that the text metrics calculated by Android 4.3 slightly differs than Android 4.2 for the same device.  Android 4.3 calculates a smaller fractional width compared to Android 4.2 for the same text.  Nothing that rounding up to the next pixel can’t solve.  That’ll prevent the text form wrongly wrapping.  But that said, this means that the object returned by display.newText() will have a slightly smaller contentWidth compared to Android 4.2, such as by 1-2 pixels.

In any case, this issue is now fixed.  The fix will be made available in daily build #1176.

Thank you for reporting this issue.

+1  

Happening on Galaxy Nexus as well after update JB4.3.  

Is there any indication of when the fix will be released in the starter edition?

The engineers are planning the next public release.  I don’t have a date yet.

Can you say when 1176 will be made available?

Thanks

I second that, as I’d need this issue fixed urgently because it is blocking a release we inteded for today :frowning:

This is not an issue if you do not use the system font. We are just replacing the system font with an imported font throughout the app… This has the side benefit of making the text the exact same size on iPhone/Android.

May I ask what font you are using to replace the system font and where you got it?

You can use any true type font you want… There are thousands on the internet for free. Just search for free fonts…  We are using a great Star Trek font since our app has a scifi Theme :slight_smile:

Unfortunately I’m using a custom TrueType font (Google LobsterTwo) and am seeing the issue, suspect the issue will vary font by font.

Yea, I just noticed one place where it is still messed up.  Corona, any info on the availability of 1176???

We have these two fonts working without the bug showing up:

“Final Frontier”

“Freeroad” 

Both were listed as free… But you never know, so use at your own risk.

Her is a link to Freeroad:http://www.dafont.com/freeroad.font

Hi @mikereichle,

Build #1177 is now available. Can you please check the release notes and test if the text issue has been resolved for you?

http://developer.coronalabs.com/release/2013/1177/

Thanks,

Brent

We spent out time today replacing the system font, testing and releasing the build to play… So we don’t need the fix anymore… But I’m sure this is effecting many, many developers out there who don’t even realize that it is a problem… An email might be in order from Corona since this could lead to many negative reviews.

Mike

Odds are that changing to a custom font will *not* solve this problem.  The reason it appears to work on your device is because the fractional text metrics being returned by Android happens to be 0.5 pixels or higher, causing the text renderer to round up to the next pixel.  But if you run the same app on a device with a different resolution/DPI, then you may get text metrics lower than 0.5 pixels, causing it to round down and run into this text wrapping issue.  This just isn’t a good solution.

The newest Corona daily build now always rounds “up” when we receive fractional pixel sizes from the OS when calculating text metrics.  This is the correct solution.