Search Unity

Font rendering problem on Android only - GUI.Label()

Discussion in 'Android' started by jonlab, Dec 28, 2011.

  1. jonlab

    jonlab

    Joined:
    Apr 6, 2010
    Posts:
    182
    Hello,

    We have a text rendering problem on our game, on Android.
    Most parts of the time, everything works well as expected.
    On iOS and web, no problem, everything works well.

    But sometimes on Android only, texts are broken in different ways :
    -horizontal transparent lines (the text is "horizontally cut".
    -transparent gradient : the texture seems to fade to transparent.
    -blocky black characters.
    -no rendering at all (I think "text totally transparent").
    (see several screenshots)

    These are GUI.Label() calls with Custom Fonts (Custom style).

    This happens especially when :
    -the phone goes itself asleep and switched back awake (power button).
    -the phone is put asleep and switched back awake (power button).
    -the app is put on background (home) and put back on foreground (by clicking on the app icon).
    -we use a native plugin (ZXing code bar reader). we Start a scan using the plugin and return to the game.

    Some informations :
    Unity Version : 3.4.2f2 all pro
    App targeted to GL ES 2 only.

    The devices we tested on :
    several Google Nexus S (the problem happens often on some devices, rarely on others… all in Android 2.3.6).
    Samsung Galaxy S2 (the problem happens very often).

    Some pictures : The same ingame font test screen :

    Ok, rendering ok :


    Rendering broken, gradient style :


    Rendering broken, blocky style :


    Any ideas ?
    Would this be a bug on Android ? GL ES 2 problem ? Graphic driver ?
    It seems to be some issues with the textures (freed, allocated 2 times, memory overwrite...)

    Thanks !
     
  2. jonlab

    jonlab

    Joined:
    Apr 6, 2010
    Posts:
    182
    I did more tests, and it seems to be related to the "Graphics Level" Player setting :
    In open GL ES 2.0, text rendering problem occurs.
    In open GL ES 1.x, no problem.

    So my game stays in open GL ES 1.x for the moment, I hope this will not have undesired side effects...
     
  3. Sunrift

    Sunrift

    Joined:
    Oct 13, 2011
    Posts:
    18
    I had the same problem, and found the same fix.

    BUT, it's NOT a fix!

    What if you design a game that needs the more advanced graphics options?

    Please report this issue to Unity, as I did, and hopefully they will get us a patch. =)

    I might add that this problem does not occur on all devices, I have seen it on Galaxy S, as you mentioned, but my Incredible 2 does not suffer from it.
     
  4. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    Hi!

    I was unable to find a bug report on this issue do you remember the case number?
     
  5. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    I noticed this too with GL2.0 it seems to occur when you switch apps using the icon bottom left on the android home page, rather than going via the apps icon top right, tested on a Samsung Galaxy II. Lucky I only need opengl 1.x as 2 is too slow on android currently.
     
  6. DamianGto

    DamianGto

    Joined:
    Apr 20, 2011
    Posts:
    159
    I was messing around with font to.
    But I now use unicode mode. For me it works best and I have now zero problem with the fonts.
     
  7. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Weird I'm using Unicode too but still seeing the issue in GL2.0, but only when the app is launched from that particular menu. The only thing that totally fixed it for me was using GL1.x
     
  8. DamianGto

    DamianGto

    Joined:
    Apr 20, 2011
    Posts:
    159
    Maybe your font is not good and thats why you have those problem.
    Try an other font to see if the problem is still there.
     
  9. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Well I can't use GL 2.0 anyway for other reasons so it doesn't matter to me.