changing Text font and fonstyles?

At the moment I have created the following script which creates a button which is great.

if(GUI.Button (new Rect(Screen.width/2 - test_buttonWidth/2 - test_buttonHorizonalSpacing, Screen.height/2 - test_buttonHeight/2 - test_buttonSpacing, test_buttonWidth, test_buttonHeight), “I am bold”))

The problem is how the hell do I manipulate the freaking text within the script.

Anytime I mess with this code to add in anything in the way of GUISTYLE, Font, Fontstyle then mono goes berserk.

I have already made some public variables

such as

font_type and font_style and on “Awake” i can change those values to whatever which is great but it doesn’t interact with the text on the button at all.

Where am I going wrong with this?

I would recommend to put all fonts inside a folder named “Resources” and use Resources function to access them on Runtime.

That means for example for Arial you need both italic and bold, you need to have two font files inside the Resources folder.

Arial - italic

Arial - Bold

and then load them to the GUISTyle on runtime.

Hope that helps.