Author Topic: Dynamic font randomly don't show properly  (Read 60444 times)

eddieB

  • Guest
Re: Dynamic font randomly don't show properly
« Reply #15 on: June 04, 2013, 12:01:26 AM »
thanks.
if you have any fix we can run the test on the devices and give you some feedback if you want.


sekai0716

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Dynamic font randomly don't show properly
« Reply #16 on: June 04, 2013, 08:05:53 PM »
@raon

do you waiting some frame? and clear character and use the MarkAsDirty() after ?
make sure that there isn't any UiFont calculation after  clear characterInfo.

this bug fix works on our project but maybe it's not the better for everyone. 
the bug also appending a lot if you are making a lot of font.

for example if you are making the arialFont 24px,12px,30px
on our project we made a font of 40px and change the scale of label of the desired scale.


I'm trying to solve this problem and it's not really working..
I have no understanding about UIFont system, so it's kinda hard to understand and test your debugging solution.
Could you please give some example sources?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Dynamic font randomly don't show properly
« Reply #17 on: June 04, 2013, 08:35:05 PM »
Problem with C++ based fixes is they take months to get through QA... so if a work-around can be found earlier on the C# side, it'd be swell.

haoxiucai001

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: Dynamic font randomly don't show properly
« Reply #18 on: June 04, 2013, 09:27:37 PM »
I am very headache for this problem

eddieB

  • Guest
Re: Dynamic font randomly don't show properly
« Reply #19 on: June 05, 2013, 12:39:18 AM »
@sekai0716
i'm going to need some time to make the demo
as i need to make one where i can reproduce the bug and show it when it's fixed.

haoxiucai001

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: Dynamic font randomly don't show properly
« Reply #20 on: June 06, 2013, 07:01:30 AM »
Qualcomm very frequently

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Dynamic font randomly don't show properly
« Reply #21 on: June 06, 2013, 09:25:33 AM »
Do you have more than one dynamic font referencing the same TTF? Do you use the same font anywhere else, such as OnGUI? Both of these would cause issues according to the guy who added this feature to Unity. Reason being, one font gets updated and changes the source texture -- the other font won't know about this.

dillrye

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 30
    • View Profile
Re: Dynamic font randomly don't show properly
« Reply #22 on: June 07, 2013, 08:54:14 AM »
I am having the same problem.  ArenMook, Is a suggested fix to this renaming the TTF file for each font size?   

Currently we are using a single TTF, but have 4 dynamic font prefabs for the different font sizes we use. Are we using this correctly?

Thank you,
Dylan

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Dynamic font randomly don't show properly
« Reply #23 on: June 07, 2013, 08:07:44 PM »
Ok so that is what's causing your problem.

I know how to fix it then -- I will do it once I am back in town.
« Last Edit: June 07, 2013, 09:38:28 PM by ArenMook »

haoxiucai001

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: Dynamic font randomly don't show properly
« Reply #24 on: June 07, 2013, 09:23:56 PM »
Very often
Qualcomm cpu

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Dynamic font randomly don't show properly
« Reply #25 on: June 09, 2013, 10:40:31 AM »
Try replacing the UIFont.CheckIfRelated function with this:
  1.         static public bool CheckIfRelated (UIFont a, UIFont b)
  2.         {
  3.                 if (a == null || b == null) return false;
  4.                 if (a.isDynamic && b.isDynamic && a.dynamicFont.fontNames[0] == b.dynamicFont.fontNames[0]) return true;
  5.                 return a == b || a.References(b) || b.References(a);
  6.         }
And if that doesn't work, try simply changing it to:
  1. static public bool CheckIfRelated (UIFont a, UIFont b) { return true; }
I'm curious to see if that will fix it.

eddieB

  • Guest
Re: Dynamic font randomly don't show properly
« Reply #26 on: June 10, 2013, 12:00:23 AM »
On my project we use only one font.

but the demo scene of anhpham http://www.tasharen.com/forum/index.php?topic=4415.msg21464#msg21464 he use the same ttf for all the size of font.
so it can be the problem for him to.
i try this demo myself and the way of reproducing the bug is to navigate a lot and quitting and starting the apply a lot.

 

anhpham

  • Guest
Re: Dynamic font randomly don't show properly
« Reply #27 on: June 10, 2013, 12:40:47 AM »
I tested both 2 ways but the bug is not fixed on my demo project


  1.         static public bool CheckIfRelated (UIFont a, UIFont b)
  2.         {
  3.                 if (a == null || b == null) return false;
  4.                 if (a.isDynamic && b.isDynamic && a.dynamicFont.fontNames[0] == b.dynamicFont.fontNames[0]) return true;
  5.                 return a == b || a.References(b) || b.References(a);
  6.         }
And if that doesn't work, try simply changing it to:
  1. static public bool CheckIfRelated (UIFont a, UIFont b) { return true; }
I'm curious to see if that will fix it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Dynamic font randomly don't show properly
« Reply #28 on: June 10, 2013, 02:53:24 AM »
Alright, thanks... well, then the issue is indeed inside Unity.

haoxiucai001

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: Dynamic font randomly don't show properly
« Reply #29 on: June 12, 2013, 09:07:37 PM »
but 
i try use  unity 's 3dText or gui Text with  chinese font work well ! no problem
this font's gibberish can be trouble on ngui's uilabel
on Qualcomm Technologies CPU