how can we increase the font size of a gui label, textfield?
You do it the same way you alter anything else in terms of font display. Declare a new GUIStyle. Alter the parameters of the font as you wish, in this case font size.
var BigFontStyle : GUIStyle;
Then have your label make use of the new style.
GUILayout.Label("Text", BigFontStyle);
And just as a reminder, you have to duplicate and import each font separately for the sizes you want.
I’m also trying to increase the font size of a GUI.Label with a custom GUIStyle. “size” is nowhere to be found in the Inspector as an option for the GUIStyle.
The font itself has no parameters you can see or change. Can you elaborate on how to do this? Maybe I’m missing something…
The size is tied to the font texture/material. So you have to duplicate the font material (which is a copy of the truetype font file itself) and then import it at a different size. Then attach that font material to your GUIstyle.
Hmmmmmm…Thanks for the reply. I tried to do what you suggest and I still don’t see any parameters. In fact, I don’t have a “True Type Font Importer” component at all like the first screenshot here suggests:
Is this what you are talking about?
Also, it is a .ttf file.
yes, that’s the place to set the size
Hmmm any idea why it isn’t showing up?
The only thing I can think of is that there is something “wrong” with that font. All the TTF fonts I’ve tried show the importer settings in the inspector just fine, including the font size option. Does this same thing (lack of importer options) happen with other fonts?