I have a working font prefab.
I can use the font in the GUI editor. I want to assign the font in code.
GameObject font = Resources.Load ("gui/HardpixelFontdata") as GameObject;
tk2dFontData fontdata = font.GetComponent <tk2dFontData>();
And then on an existing.. tk2dTextMesh object
tk2dTextMesh textmesh = option.GetComponent <tk2dTextMesh>();
textmesh.font = fontdata;
The text is invisible! If I don't set the font in code, it's fine. No errors are outputted to the console.