Author Topic: Dynamic Text on Android Devices  (Read 5236 times)

kyledouglasolsen

  • Guest
Dynamic Text on Android Devices
« on: May 22, 2013, 01:13:38 PM »
We're having an odd issue:



It seems that dynamic text will randomly break and stop rendering specific letters on several of our Android devices. Any ideas on what's causing it?

Thanks,
Kyle

physikal

  • Guest
Re: Dynamic Text on Android Devices
« Reply #1 on: May 22, 2013, 04:02:35 PM »
We have this same exact problem, I'm curious to see what the fix is!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Dynamic Text on Android Devices
« Reply #2 on: May 22, 2013, 09:42:13 PM »
No idea, I've never seen it happen, but if you find out, let me know.

brzozowsky

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Dynamic Text on Android Devices
« Reply #3 on: June 23, 2013, 04:34:36 PM »
Same problem here on Android.

hungweng

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Dynamic Text on Android Devices
« Reply #4 on: June 24, 2013, 06:15:55 AM »
We're having this issue as well, not just Android devices, happened on my iPhone5 as well, just once though.
Its really hard to reproduce this issue which makes it hard to debug...

Aren said this in another post:
Quote
When the texture's dimensions change, NGUI marks the font as dirty, which in turn forces all labels to refresh their content, which should cause everything to update correctly.

According to Unity's Doc on Font.RequestCharactersInTexture:
Quote
RequestCharactersInTexture may cause the font texture to be regenerated if it does not have space to add all the requested characters. If the font texture is regenerated it will only contain characters which have been used using Font.RequestCharactersInTexture, or using Unity's text rendering functions during the last frame. So it is advisable to always call RequestCharactersInTexture for any text on the screen you wish to render using custom font rendering functions, even if the characters are currently present in the texture, to make sure they don't get purged during texture rebuild.

So its either the font's textureRebuildCallback doesn't get called, or (some of) the labels didn't refresh their content therefore didn't force the font to call the RequestCharactersInTexture?

I'm wondering, instead of calling RequestCharacterInTexture for each labels on the screen, can we call the RequestCharacterInTexture API once and pass the combined string of all the labels? Is it even worth a try?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Dynamic Text on Android Devices
« Reply #5 on: June 24, 2013, 10:47:16 AM »
There are several threads on this issue. At one point I even changed it to force-refresh every single label in the scene every time the text changed. No effect. This issue lies in Unity somewhere. Unity reports the characters being present, when in fact they are not -- at least not at the time of the request.