almo
1
When I create a “Custom Font” in Unity 4.6.1, I get this:

“Ascii Start Offset” tells it which character is first in the font. I’ve set it to 48 (the zero character) by hand, and my custom font works fine just for numbers.
But I’m creating these fonts at runtime as a build step. I access “Character Rects” through Font.characterInfo in code:
font.characterInfo = infoList.ToArray();
So the names don’t necessarily align. But I can’t figure out how to change “Ascii Start Offset” at runtime; none of the available members of Font class seem to be related. Is this possible?
almo
2
This is available in Editor Scripts:
public void SetAsciiStartOffset(Font font, int asciiStartOffset)
{
Editor editor = Editor.CreateEditor(font);
SerializedProperty startOffsetProperty = editor.serializedObject.FindProperty("m_AsciiStartOffset");
startOffsetProperty.intValue = asciiStartOffset;
// Save off all of the values to Unity's internal structure
editor.serializedObject.ApplyModifiedProperties();
}
For more details, see here: