How to set Character Rects for Custom Fonts with C#

I’m trying to make a custom Font in Unity3d with a texture.

Since setting all the Character Rects by hand seems kinda stupid for a full ascii character set, I chose to do so with a C# script.

The problem is, I can’t write anything to the Character Rects, the Rects are public but using = with single properties, = with new Rect(), .Set() or even replacing the whole CharacterInfo seem to do nothing, while changing the fonts name works flawlessly.

I tried this example with the recent versions of Unity 4 on OS X and Windows 7 and the Character Rect values just stay the same.

I had the same problem, it did work for me if I try creating new CharacterInfo instances):

CharacterInfo[] characterInfos = new CharacterInfo[128];
for(int i = 0; i < 128; ++i)
{
    var info = new CharacterInfo()
    {
        flipped = false,
        index = i,
        style = FontStyle.Normal,
        width = 64,
        size = 0,
        vert = new Rect(0, 0, 64, 64),
        uv = new Rect(0, 0, 0.125f, 0.125f), 
        /* test values for demonstration...don't actually use them */
    };

    characterInfos *= info;*

}