Author Topic: NGUI dynamic font texture became solid rectanges at some Android devices  (Read 6716 times)

beyonddoor

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
My game is developed by Unity 4.6 and NGUI, the fonts are dynamic fonts to support Asian characters, but at some Android devices the fonts failed to display properly, characters became solid blocks.


I have tried to render the font texture, the UIFont.texture is defined as

  1. public Texture2D texture
  2.     {
  3.         get
  4.         {
  5.             if (mReplacement != null) return mReplacement.texture;
  6.             Material mat = material;
  7.             return (mat != null) ? mat.mainTexture as Texture2D : null;
  8.         }
  9.     }

and property material is mDynamicFont.material, the rendering result is a solid black rectangle.

Font texture size is 512x1024, and the uv of CharacterInfo is valid, so I dont know why font texture became so wired and how to fix it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Dynamic fonts = all Unity here. If you draw the texture and it appears solid, then that's just what Unity gives NGUI to work with. It may be due to it not having enough memory, the android device not working properly when the texture is not square, or the texture size exceeding what's supposed by the device. Although if you say the font is only 1024x512, then nothing should be that ghetto. As far as I know all mobiles support 1024x1024 textures.

I would say submit a bug report to Unity, but since your Unity version is so far out of date I highly doubt they will even look at it. I'm sure they will tell you to update your Unity to the latest and try it there.

beyonddoor

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Here comes the new situation, when the font's displaying wired, I enlarge the font texture by RequestCharactersInTexture, when the texture size changed, the texture becomes normal now. still don't know what the cause and how to fix it

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Is your NGUI even up to date? NGUI requires at least Unity 4.7.