- Home /
Font size and style overrides are only supported for dynamic fonts
Since i've upgraded to Unity 4 i have the problem that all my text in the game is invisible and the warning "Font size and style overrides are only supported for dynamic fonts" is shown. I have read anywhere that i should set the character of the font to Unicode and the Font Size to 0. I have changed the charachter to Unicode, but where i have to set the Font Size to 0? Directly in the options for the Font? There it's not working for me. I set the Font Size to 0 and it changes automatically back to 1. I've also tried to set the Font Size in the GUISkin to 0, but the text is in the game still invisble. How can i fix this problem?
Answer by ffxz7ff · Oct 07, 2013 at 10:57 PM
Hi, I have the same problem as theSoenke and the first answer did not help. Here's a piece of my code:
Font font_papyrus = new Font("Papyrus");
GUIStyle guiStyle = new GUIStyle();
guiStyle.font = font_papyrus;
// A screensize issue, you see
guiStyle.fontSize = (int)(initialFontSize * resizeFactor);
Later I use the following:
GUI.Label(tempRect, tempString, guiStyle);
This leads to the error "Font size and style overrides are only supported for dynamic fonts."
In the import settings, my font is set to dynamic though. Can anyone tell me what I'm doing wrong, or a workaround? I've read that some people just save the same font in different sizes and then import the one that suits their screen resolution the best, but this just seems dirty to me.
Can anyone help?
EDIT: Nevermind, the problem was that my font wasn't showing up at all. Scaling indeed works as above.
PS. Turns out even without resizing the font, it simply doesn't show up at all.
EDIT: If anyone ever comes across the same problem, font = new Font("Papyrus"); is wrong.. font = (Font)Resources.Load("Papyrus", typeof(Font)); is right.
Answer by Graham-Dunnett · Jul 19, 2013 at 09:58 PM
Change the type of the font to Dynamic, exactly as the warning is telling you to do. Then you can change change the font size.
Any overhead on it, if we use "ASCII Default Set" and in component we change the font size??? Warning comes, but if we ignore that warning, any overhead due to this???
Your answer
Follow this Question
Related Questions
Edit font texture (unity 4) for adding special effects. 2 Answers
Is there a way to save my project? 4 Answers
Major bog down using dynamic fonts in iOS 0 Answers
Graphic glitch on UI Text 0 Answers