A class in Root.Township, the global namespace.
Asset holding the letter meshes for 3D mesh text (used by TextRenderer). Letters are looked up by character code.
Constructors
| Member | What it is |
|---|
TextFont() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
| Member | What it is |
|---|
const int MaxCharacters | Size of the lookup table (256). Only character codes below this are supported. |
const float WidthScalar | Constant 0.005, probably the scale from font units to world width. |
4 private and internal fields
| Member | What it is |
|---|
private static Dictionary<TextFont, LetterMesh[]> fonts | Static cache of lookup tables, one per font asset. |
private Font linkedFont | Backing field for LinkedFont. |
private LetterMesh space | Letter mesh used for the space character. |
private TextFont.TextFontLOD[] textFontLODs | Letter mesh sets per level of detail. Only the first one is used. |
Properties
| Member | What it is |
|---|
Font LinkedFont { get; } | The Unity font this mesh font was made from. |
Methods
| Member | What it is |
|---|
LetterMesh GetLetterMesh(char character) | Returns the letter mesh for a character, or null for codes 256 and above. Builds and caches the lookup table on first use. |
1 private and internal method
| Member | What it is |
|---|
private void OnValidate() | Editor: clears the cached lookup table so changes show up. |
Used in
Members of other types that take, return or hold a TextFont: