Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Dynamic Font Missing Character Info on certain devices

Discussion in 'Editor & General Support' started by Unity_Carlos, Jul 12, 2013.

  1. Unity_Carlos

    Unity_Carlos

    Joined:
    Jun 6, 2013
    Posts:
    4
    My team and I recently discovered an issue about dynamic font.
    We found that on most of android devices using
    Qualcomm SnapDragon APQ8064 CPU and Qualcomm Adreno320 GPU
    have a big problem.
    When we using dynamic fonts on these devices,
    and some times later, we can find that the font info is not correct.
    After debugging the info, we found the problem lead to this situation,
    while at that time some label request for a new character makes the font material recreate,
    and old label's text get the call back and request again at the same time,
    but unity told the old label that the font already get the character info,
    while the character info is point to an empty area at the texture(or wrong place),
    which will easily make the labels a mess.

    We have tested Sony L36h(Xperia Z), OPPO X909(Find 5), Xiaomi 2(Mi 2), HTC x920e(Butterfly),
    all have this problem.

    Can anyone give us a solution?
     
    ogata-daichi and artaka like this.
  2. Unity_Carlos

    Unity_Carlos

    Joined:
    Jun 6, 2013
    Posts:
    4
    Anyone here?
     
  3. DylanYates

    DylanYates

    Joined:
    May 9, 2013
    Posts:
    2
    I have discovered the same problem with dynamic fonts.

    A string of text like "The quick sly fox jumped over the lazy brown dog." will turn into something like "T e uic s y fo ju p d o r th l zy b o n g".

    In my testing this seems to happen at random times and sometimes not at all. It also only seems to happen on certain devices. It happens frequently on my Samsung Galaxy S4 but it never happens on a Motorola Xoom.

    I submitted a bug report to Unity last month about this, but it does not look like it was fixed in 4.2.
    Case # 549955
     
  4. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    This issue seems to be related with the following test case:

    https://github.com/myevan/unity-examples

    Deploy and see the rendered fonts which are correctly work. If it does not, check 'Fix' check box and see whether it will be fixed.


    And it will be appreciated the problem can be fixed tested device and let me know what the device was used.
     
  5. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,165
    Can you please raise a bug with a simple to reproduce test case so that QA can take a look?

    This may or may not be the same thing so please still raise it.
     
  6. Nub3h

    Nub3h

    Joined:
    Aug 23, 2012
    Posts:
    56
    I got the same problem here on my Galaxy S4. I hope it gets fixed soon.
     
  7. Bill-Robinson

    Bill-Robinson

    Joined:
    Sep 21, 2012
    Posts:
    6
    We have also been seeing the same thing occasionally. It is reported mainly on Samsung Galaxy S4, but also S3 and HTC One X in the past.
     
  8. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,176
    Hi, so there is no solution yet?

    or if change font from dynamic to others can solve?
     
  9. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,176
    And so bug fix is,

    https://github.com/myevan/unity-examples


    live above link's code,

    just re-assigning font's characters by font.RequestCharactersInTexture?

    So for block the occur of problem itself, call re-assigning current GUI.Label's currently showing text continuously? in OnGUI section?
     
    SmashedAvocado likes this.
  10. SmilingCatLtd

    SmilingCatLtd

    Joined:
    Jun 8, 2013
    Posts:
    7
    I am also experiencing this issue rarely and randomly, with multiple fonts and multiple projects, even with the default Arial font that is automatically set on a new GUISkin. Changing the displayed text a couple of times seems to fix it, as one of my game prototypes involves building words, and alternately backspacing and entering a letter resolves the issue after a few go's. It never seems to resolve itself for static, unchanging text. It seems to happen more on the Galaxy S3 than the Galaxy S4, though that is purely a subjective observation on this end.
     
  11. alone1992

    alone1992

    Joined:
    Oct 23, 2012
    Posts:
    156
    + this problem for me
     
  12. furic

    furic

    Joined:
    Jul 8, 2013
    Posts:
    13
    I have also got the same problem in showing Simplified Chinese in XiaoMi S2, while few others devices work...

    It works when I put a Chinese font instead Arial, but the font itself is 10mb...

    I suspect when using Airal it fallback to Android default font and somehow XiaoMi S2 couldn't handle it?

    So, I am looking for any other solution, or at least how to detect the problem so I can download the font as Asset Bundle...
     
  13. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Well, if the font you have licensed is too big, then put it through some font editing software and strip out all the fonts you do not need/want. I'm a bit of a fontforge user for this kind of thing.
     
    alone1992 likes this.
  14. furic

    furic

    Joined:
    Jul 8, 2013
    Posts:
    13
    Thanks Graham, thought of that too and will do at the end...

    But still it will be good if there is a method to detect the problem so the font is downloaded as Asset Bundle if only needed...

    I tried look at the text length using guiText.text.Length, but of course no luck, the text remain as the non-missing text and even about the print out in Debug.Log...
     
  15. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Well, if you have a font inside an AssetBundle, then you know the size of the font, since you've added it into the project. If it's 10M on disk, it'll be 10M when it's loaded into the runtime. It might be slightly smaller if the asset bundle code can compress it.

    I guess you can render a glyph which you know causes problems into a render texture, and then look to see if that render texture is still all black. If it is, then you know the dynamic font rendering couldn't render the glyph. Or build up a list of devices that you QA on that shows the problem. It's only when Unity asks the OS to render your text using a system font that the problem arises. The script side will look okay - the guiText.text will have all the characters you have put into it. It's the rendering that produces nothing.
     
  16. artaka

    artaka

    Joined:
    Feb 19, 2013
    Posts:
    128
    Any updates on this issue? Random letters and numbers in a string continue to disappear in version 4.6.9p2.
     
  17. artaka

    artaka

    Joined:
    Feb 19, 2013
    Posts:
    128
    I noticed in Unity 5.3.0 release notes that "font characters disappearing" issue was fixed.
    Is there a chance this fix may be applied to 4.7.x?
     
  18. nOsmircK

    nOsmircK

    Joined:
    Mar 18, 2014
    Posts:
    8
    This is still happening on 5.3.3f1.

    I'm using The Open Sans font that comes with the Standard Assets. Default settings (size 16, dynamic).

    Only on iOS tested devices: iPad2, iPhone 5, iPhone 6. This problems occurs, some random characters are missing on every Text Object on the new UI system.
     
  19. timothy_yau

    timothy_yau

    Joined:
    Mar 22, 2016
    Posts:
    1
    I'm having this problem as well, on 5.3.5f1 and with WebGL builds.

    My workaround is to have offscreen Text objects for every font and size combination, listing all of the characters that will be used. This is obviously very annoying, especially when "Best Fit" is used on the Text objects, because all possible sizes have to be included.
     
  20. AndyJRussell

    AndyJRussell

    Joined:
    Mar 21, 2016
    Posts:
    8
    We have also been getting this on our iOS builds, after some investigation it seems to be related to OpenGL, using Metal stops the problem. I tried to create a repro project to submit a bug but I've got no idea on how to trigger the problem and our project is way to big to submit.
     
  21. SB_Oc

    SB_Oc

    Joined:
    Jan 5, 2018
    Posts:
    1
    Facing same issue in UNITY 2017.4.36f1. Any clue?
     
  22. xeniaosense

    xeniaosense

    Joined:
    Aug 4, 2020
    Posts:
    3
    Met the same issue in Unity 2019.4.18f1 for my WebGL build. Random characters missing sometimes. In the editor it does not happen at all.
     
unityunity