2
\$\begingroup\$

I am using NGUI and I have a UILabel. It uses Unity dynamic font Arial. Bold. No effects.

This is how it looks in the Unity editor:

enter image description here

And that's how I want it to look. When I build it in iOS, it looks the same. Great.

Then I updated Unity to 5.1.2. In editor it still looks the same, but now in an iOS build I get this:

enter image description here

The label looks different. It looks like a different font and style.

This line of code:

Debug.Log("Using " + label.trueTypeFont + "  " + label.fontStyle + " size " + label.fontSize);

And regardless of being in Unity's editor or the iOS device, I get this:

Using Arial (UnityEngine.Font) Bold size 24

So apparently this is indeed Arial. And the size is supposedly the same. Then, what is wrong?

This occurs on all iOS devices I use (iPhone 6+, iPhone 6, iPad Mini 3, etc...) with the latest iOS version. I also have the latest NGUI. I think it was the Unity update itself.

What happened? What do I do? I want the old look. I suppose that I can grab an older Unity and use one of my backup projects, but this new Unity actually has several fixes I'd like to have so...

Edit: Confirmed that Unity 5.0.1 doesn't have this problem. It occurs in newer versions like 5.1.1.

\$\endgroup\$
1
\$\begingroup\$

Solved a similar issue on Android Unity 5.1.1 by removing and re-importing the actual font file into my project. Also have seen problems when using just the default Arial font face without actually importing my own font asset into the project.

Do me a solid and try importing an actual Arial (or any other font for that matter) TTF or OTF into the scene and using that file in the reference for your next build. I think the problem relies either in Unity linking to its "included" version of Arial when building for mobile / tablet devices. At least that is what has worked for me in 5.0.1 and 5.1.1

\$\endgroup\$
  • \$\begingroup\$ Is there a way to solve this without using my own font file? I support lots of language so I will have a very large TTF file. I also suffer from this, Unity 4.6.7, using latest NGUI. I only experience it on iOS 9 and above. \$\endgroup\$ – Ray Lionfang Jul 8 '16 at 10:31
0
\$\begingroup\$

Use BMFont to generate the font sprite atlas, and use that as an NGUI font, not a Unity font. Then you will get the exact look you want, instead of having version specific fonts.

There is a tutorial here on Youtube, showing how to use BMFont and import into NGUI.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.