Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Arcanor on January 01, 2014, 05:28:43 PM

Title: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: Arcanor on January 01, 2014, 05:28:43 PM
updated from 3.0.8 to 3.0.8f3 and my dynamic fonts no longer show on their labels (labels appear blank even though they have text in them).  They all disappeared entirely.  I was able to resolve it by selecting a different font, which seems to kick in some initialization logic and makes the text show on the label again.  I can then re-select the original font and it works fine.  But this has to be done separately for each label.

CORRECTION.  After hitting play in the unity editor all the labels revert to blank again as above.  Help!!!
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: Arcanor on January 01, 2014, 05:40:17 PM
Found another workaround, which seems to work this time.  If I set "Keep Crisp" to "Never" the dynamic fonts reappear and seem to work properly.
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: ArenMook on January 01, 2014, 07:29:59 PM
o_O

Are you sure the Asset Store says there is no update available? I had to reupload f3 twice due to some issue with it. All dynamic font-using labels work correctly on my end, shrunken or not.
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: Arcanor on January 02, 2014, 03:39:56 AM
Just checked and the Asset store says I already have the latest update.
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: Arcanor on January 02, 2014, 04:02:00 AM
I have double-checked this by starting a new project and importing ONLY the following:

I open the Menu Scene from UISK and select the Play button label in the Main Menu panel.  Change to Dynamic Font, select Arial.  Hit play in the Unity editor and the word "Play" disappears.

Here is a screenshot:  http://screencast.com/t/U7mAAcFf6GG (http://screencast.com/t/U7mAAcFf6GG)
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: ArenMook on January 02, 2014, 11:11:16 AM
Ah, if you look at inspector you will notice that the label's height is 0. My guess is that something is off with how it resizes itself (since it's set to resize height). Change labels to "shrink to fit" until I fix it in f4.
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: Arcanor on January 02, 2014, 11:39:27 AM
Thanks for the reply.  Setting overflow to "shrink to fit" as you suggest doesn't seem to help, but as I mentioned above, setting "Keep Crisp" to "Never" fixes the problem (until you patch it in f4, then I can set it back).
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: ArenMook on January 03, 2014, 03:44:20 AM
I followed your instructions:

1. Imported Starlink UI kit.
2. Imported NGUI 3.0.8 f3.
3. Opened the Menu scene.
4. Selected the Play label, changed it to Dynamic font, Arial, size 32.
5. Hit Play. Everything works as expected, label doesn't disappear. Height remains at 32.

So either you really don't have the last f3 (as I said I had to upload twice), or something else is wrong that I can't reproduce. I suggest you try it again with f4 and if it still happens, see if you can provide further details.
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: Arcanor on January 03, 2014, 05:00:12 AM
Thanks for sticking with me. :)

Here is a video of me doing the whole process, doing exactly the steps we've both listed (about 5 minutes), and including downloading new versions of UISK and NGUI from the Asset Store (even though it didn't indicate there were new versions available).  As before, my dynamic font label disappears as soon as I hit the Unity editor play button.

http://screencast.com/t/RDfD2EkW1i4e

There must be something different about our system or Unity installs.  I'm running Unity 4.3.1f1 on Windows 7 SP1.  Is there some other identification of my environment I can offer?
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: ArenMook on January 03, 2014, 05:52:45 AM
Yup, same steps for me and yet... everything is fine. I'm also on Win7 SP1, Unity 4.3.1. o_O

Did you try navigating to the NGUI page on the Asset Store and seeing if the "update" button shows up there? I'm going to put up f4 shortly, but you can add me on skype (arenmook) if you want that version early, just in case you want to try it with that.
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: Arcanor on January 03, 2014, 08:13:33 AM
I looked again just now and I've now updated to NGUI 3.0.8f4, but same results. :(
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: ArenMook on January 03, 2014, 09:58:24 AM
f4 actually added extra code in there that made it impossible to set height to 0 via auto-resizing (check the UILabel.ProcessText function), so I simply don't see what's setting it to zero in your case... Can you add some Debug.Logs in there to see where the zero height is coming from?

Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: Arcanor on January 03, 2014, 10:04:06 AM
It's setting it to 2px height, not 0, but again, that's only with "Keep Crisp" on.  Does that help?
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: ArenMook on January 03, 2014, 10:19:58 AM
Ok, the good news is that I was able to reproduce it, and damn, talk about an EDGE case :P

1. Keep crisp is impossible in this case as it's a 3D UI. It should be off anyway.
2. Only seems to happen with fixed size UIs + keep crisp + 3D.
3. Trying to reproduce it outside of the Starlink UI kit fails no matter what I do. Even copying the button out into a brand new UI hierarchy doesn't repro the issue.
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: ArenMook on January 03, 2014, 10:59:00 AM
So here's the fix... line 618 of NGUIText.cs uses "finalSize". It should be "finalLineHeight" instead:
  1. float height = (maxLines > 0) ? Mathf.Min(rectHeight, finalLineHeight * maxLines) : rectHeight;
Title: Re: ALL dynamic fonts disappear with 3.0.8f3 update
Post by: Arcanor on January 03, 2014, 12:00:06 PM
Works!  Thanks Michael. :)