Assign / change font from script

Hi,

is it possible to assign a font from script? The font exists in my project.

this is my code:

GameObject tf = new GameObject();
tf.transform.position = new Vector3(.5f, .5f, 0);

GUIText guiText = tf.AddComponent(typeof(GUIText)) as GUIText;
/*
guiText.font = ... 
*/
guiText.text = "test";

isnt it possible?

http://forum.unity3d.com/viewtopic.php?t=10175

Possibly the closest thing to what I believe you’re after.

thank you.

i thought it could be all done by the script - creating style and font and so on - but now i assigned the font to a GUIStyle in the editor and use it in my script:

...
public GUIStyle guiStyle = new GUIStyle();
...
guiText.font = guiStyle.font;
...