Author Topic: Can't build when using Dynamic font Lucida Grande  (Read 6438 times)

Enzign

  • Guest
Can't build when using Dynamic font Lucida Grande
« on: November 01, 2013, 03:39:01 PM »
When trying to build a scene with a UILabel using the font Lucida Grande as a Dynamic font i get the error:
"An asset is marked as dont save, but is included in the build:"
and then there is supposed to be the offending asset. If i use Arial as the Dynamic font it works fine.

Or is the Dynamic font all in Unity and not NGUI?

I don't know where the Lucida font comes from though, there is no Lucida asset in the project, but when choosing font from a clean project with only NGUI added it shows up in the list when picking a dynamic font.
« Last Edit: November 02, 2013, 03:39:04 AM by Enzign »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Can't build when using Dynamic font Lucida Grande
« Reply #1 on: November 02, 2013, 08:08:16 AM »
Internal unity font, I'm guessing. I am not seeing it on my end, just Arial which is always included.

If you're going to use a dynamic font you should first ensure that its font file is in your project.

mirraraenn

  • Guest
Re: Can't build when using Dynamic font Lucida Grande
« Reply #2 on: December 24, 2013, 04:14:54 PM »
I had this same problem, and didn't quite believe that it was a missing font reference at first. However, you can confirm this is the problem by removing all NGUI elements from the scene and attempt to build again. I eventually narrowed this problem down to two Popup UI elements whose font was set to a nonexistent Lucida Grande font. I used the methodology below. I hope this is of some use to anyone who has this problem.

NOTE: To fix this problem, you can't just look for UI Labels and do a replace on the fonts they use. Other elements have a reference to Fonts that are not easily revealable just by searching. The best way to troubleshoot this is to
1. Make a prefab of your NGUI UI setup.
2. Put it into a blank scene
3. However you organize your UI (likely multiple top UIPanels) delete the top-most orgizanational elements one at a time and build until you are able to successfully export a build. That way you can narrow down the area that has that Lucida Grande null reference set and then look in your prefab for the UIElements whose font is set to it.

PS. I'm not sure what originally broke the UI because this used to work just fine, and then suddenly stopped working (I didn't notice for a while because I didnt build for three-four weeks). I would love to hear the cause though; a lot of people have ascribed this to Unity 4.3 breaking something, although I haven't seen that confirmed.

Meltdown

  • Jr. Member
  • **
  • Thank You
  • -Given: 10
  • -Receive: 0
  • Posts: 56
    • View Profile
Re: Can't build when using Dynamic font Lucida Grande
« Reply #3 on: January 19, 2014, 09:23:32 PM »
I get this problem too, and can confirm it's caused by having a dynamic font in NGUI 3.0.8 f4.
I have a simple scene, with a UI camera, and HelveticaNeue-Bold.otf which is marked as dynamic. The font is included in the project.

I cannot build for Windows Store apps though after creating this new UI in a new scene. As soon as I remove the label, the project builds.

EDIT : Never mind, after trying to create a repro I couldn't replicate. All I needed to do was close Unity and re-open and the issue was resolved  :o
« Last Edit: January 19, 2014, 10:03:45 PM by MeltdownZA »

madcalf

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Can't build when using Dynamic font Lucida Grande
« Reply #4 on: January 23, 2014, 02:45:49 PM »
I also just had this problem. And if it weren't for this thread, i would literally have pulled out all my hair by now!  I originally thought the problem was with my .otf fonts. So i deleted all those and also deleted my Library folder in case there were lingering references to them there, and restarted Unity. That didn't resolve the issue. So after finding this post i found i had 4 inactive UILabels with the offending Ludida Grande and just changed those fonts. I didn't have to go thru the steps in mirraraenn's post. And my .otf's work fine now that i have re-added them.

FYI, I never installed Lucida Grande as an asset in my project.  I notice that it doesn't show up in the default Unity font dialog. But it does show up in NGUI's font dialog along with Arial and all my .otf fonts, but only one of the two .ttf fonts that i had added as assets. Maybe Lucida was used in the NGUI demo's but not distributed with the package? Is there any way to remove these references to it from the NGUI font dialog?

Screenshot is included for reference if it helps. Using NGUI 3.0.8f7 with Unity 4.3.1f1.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Can't build when using Dynamic font Lucida Grande
« Reply #5 on: January 24, 2014, 09:52:25 AM »
NGUI doesn't come with any dynamic fonts. Lucida grande must be used by Unity Editor, so it shows up when you do Resources.FindObjectsOfTypeAll(typeof(Font)). I'll manually remove them in the future, just to be safe.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Can't build when using Dynamic font Lucida Grande
« Reply #6 on: January 24, 2014, 10:15:06 AM »
Update: I've added a clause in there to remove fonts that have no path associated with them with the sole exception of Arial. I've also made it so that the dynamic fonts will now show up properly when you do a search. I noticed there was a bug there. Anyhow, 3.0.9 f5 should have the fix.

renanse

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 1
  • Posts: 14
    • View Profile
Re: Can't build when using Dynamic font Lucida Grande
« Reply #7 on: December 03, 2015, 03:36:41 PM »
fwiw, this appears to have regressed.  I can pick one of the internal Lucida fonts again in the font chooser and make my project un-buildable.