Unity 3-b6 iPhone Fonts problem ?

is it a U3 B6 bug or something I missed ?

I have a simple GUIText and I got this error message looping on the xcode console when running the app.

Font size and style overrides are only supported for dynamic fonts.
 
(Filename: /Applications/buildAgent/work/ba2af227d3fa2d82/Projects/../Runtime/Filters/Misc/Font.cpp Line: 116)

Font size and style overrides are only supported for dynamic fonts.
 
(Filename: /Applications/buildAgent/work/ba2af227d3fa2d82/Projects/../Runtime/Filters/Misc/Font.cpp Line: 219)

I have tried with all king of fonts but I still have this message looping on the console.

A bug or is it coming from me ?

Haven’t used GUI fonts yet in U3 but I think the issue is that you use bitmapped fonts and try to size them, which you can’t. You need to use the new options to directly render ttf fonts to get the option to size fonts. Don’t know if you can use ttf fonts on iOS and if so how well it would perform, but just try and see.

Seems that U3 B6 does not allow to import dynamic fonts.
Here is the message I got from Unity trying to import .ttf fonts.

BUT Unity still generate xcode code that overrides styles/size and so it turns xcode sending the error messages.

If you stay with the default font Arial and change nothing to the size, it’s fine… but small…

at least previous versions only pretended to not support it.
the main reason you shouldn’t use them is that you have no way getting at the bold and italic versions, they only work when you select “dynamic” instead of unicode which is not available outside the desktop

I’ve been having the same issues with fonts. I imported 2 ttf fonts, and everything was fine… no warnings or anything… and then suddenly out of nowhere i do a build and my console is filled with the above warning.

So does this mean we can ONLY use the Arial default font? If so, that’s really limiting lolol… i really wanted to use GUIText etc, but if it only allows arial i’m kind of screwed as it doesn’t fit with the style. And can’t change the size? That’s weird.

No you can use other fonts too, thats no problem.

groovfruit, did you ever figure out those errors? I’m getting those two after trying to import a TTY font.

I’m just trying to display text in a font that’s not super-tiny on iPhone 4. Posted this companion thread too: http://forum.unity3d.com/threads/67726-How-to-change-size-style-a-GUI.Label-on-iPhone

Just wanted to add that I was also getting this issue. In addition to the message “Font size and style overrides are only supported for dynamic fonts.” spamming in the xcode console window, it was also causing slow performance for my simple app. Eventually (a minute or two of use), my app would crash out with the final error message “exceeded 500 log message per second limit”.

My test app is pretty simple, but it did have 3 GuiText objects for which I had increased the font size. The errors and crashes went away when I changed over to using default, script defined Gui.Label() objects.

I haven’t tried adjusting the size with these to see if the error comes back. I’m just glad to be rid of it for now!

I’m using Unity 3.1.0f4 with an iPhone 3G.

same problem for me, lots of warnings

I get this warning too. Haven’t figured out how to solve it yet.

Just to put my hand up here, I am also having this issue. Only just started deploying our title to iPhone, but it eventually falls over due to this.

First of all, Dynamic fonts are only supported on PC and MAC platforms.
So in order to get fonts to work on Mobile devices you must use Unicode for the Character set.

This is what you need to do.

  • Import a TTF font file in Unity.
  • Set the Character Set to Unicode.
  • All other information is up to you, size, anti-aliasing, etc
  • If you use the font in a GUIText, make sure that the “Font Size” is set to “0” and “Font Style” is set to “Normal”.

If one of your GUIText is set with different values for those two fields, you will get the error message!

I hope this helped.

I have the same problem where on Mac and iphone, the font is really tiny and in the Unity Editor on Mac I get spammed with ‘Font size and style overrides…’ message.

My font is a TTF and I have set the ‘Character Set’ to Unicode. This made my font a little bigger but I still get spammed with that warning in the console. I’m using the font in a GUIStyle. These are the properties of the GUIStyle I’m using:

Normal → Text Color: set my color here
Font: Dragged my imported TTF here
Font Size: 28
Alignment: Upper Right

Everything else is default. Derell Nar said the following:

  • If you use the font in a GUIText, make sure that the “Font Size” is set to “0” and “Font Style” is set to “Normal”.

What about if I’m using the font in a GUIStyle? If I set the font size to ‘0’, how do I actually set the size of it?

Ok I changed font size in the GUIStyle to 0 and now the message no longer appears. But the font size is still too small, how do I increase it without changing ‘font size’ in the GUIStyle? Here’s my label:

GUI.Label(new Rect(5, 83, 60, 80), score.ToString(), fontStyle);

If I increase the size of the Rect, it just makes the label bigger but doesn’t increase the size of the font.

I just found out you can change the size of the font by changing ‘Font Size’ in the TTF properties (where you change ‘character’ to unicode). I have several different GUIStyle’s using this TTF font, specifically for the purpose of different font sizes. So it looks like i have to import the TTF multiple times, one for each size that I want.

Solution found indeed- thanks Darell!

Yeah the only real way to change your font size is to do in the TTF in Unity.
If you need different font sizes because of different Resolutions, you’ll have to duplicate the TTF in Unity and give them different font sizes.
In code you can choose which font to choose based on resolution…

Pseudo code example:

// Fonts assigned in Inspector
public GUIStyle myStyle;
public Font fontRes1;
public Font fontRes2;
public Font fontRes3;
if (Resolution1)
myStyle.normal.font = fontRes1;
else if (Resolution2)
myStyle.normal.font = fontRes2;
else if (Resolution3)
myStyle.normal.font = fontRes3;

Solved!!! Thanks Derell so much.

Setting font size to zero fixed this for me. I thought if I made the size the same size as the imported font that’d be fine, but that’s not the case. Thanks Derell for the fix.

That worked for me. Thanks a lot.
For the benefit of others, here’s how I got into this problem in the first place. I developed a game using Unity 3.3 for iOS. I upgraded to Unity 3.4 and continued working on my game using Unity 3.4. I believe there are some serious bugs/issues with 3.4 due to which my game performance degraded and started causing memory warnings. So I downgraded to Unity 3.3 and opened the game using Unity 3.3 and started seeing all sorts of errors and warnings (like this font issue being discussed in this thread). I had to manually fix the project to behave well with Unity 3.3. I’ve learned my lesson. I should have backed up my project before opening it with the newer version of Unity.