Class TMP_FontAsset
Inheritance
System.Object
TMP_FontAsset
Inherited Members
UnityEngine.ScriptableObject.SetDirty()
UnityEngine.ScriptableObject.CreateInstance<T>()
UnityEngine.Object.GetHashCode()
UnityEngine.Object.Equals(System.Object)
UnityEngine.Object.InstantiateAsync<T>(T)
UnityEngine.Object.InstantiateAsync<T>(T, UnityEngine.Transform)
UnityEngine.Object.InstantiateAsync<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.InstantiateAsync<T>(T, UnityEngine.Transform, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.InstantiateAsync<T>(T, System.Int32)
UnityEngine.Object.InstantiateAsync<T>(T, System.Int32, UnityEngine.Transform)
UnityEngine.Object.InstantiateAsync<T>(T, System.Int32, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.InstantiateAsync<T>(T, System.Int32, System.ReadOnlySpan<UnityEngine.Vector3>, System.ReadOnlySpan<UnityEngine.Quaternion>)
UnityEngine.Object.InstantiateAsync<T>(T, System.Int32, UnityEngine.Transform, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.InstantiateAsync<T>(T, System.Int32, UnityEngine.Transform, UnityEngine.Vector3, UnityEngine.Quaternion, System.Threading.CancellationToken)
UnityEngine.Object.InstantiateAsync<T>(T, System.Int32, UnityEngine.Transform, System.ReadOnlySpan<UnityEngine.Vector3>, System.ReadOnlySpan<UnityEngine.Quaternion>)
UnityEngine.Object.InstantiateAsync<T>(T, System.Int32, UnityEngine.Transform, System.ReadOnlySpan<UnityEngine.Vector3>, System.ReadOnlySpan<UnityEngine.Quaternion>, System.Threading.CancellationToken)
UnityEngine.Object.Instantiate<T>(T)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.DestroyObject(UnityEngine.Object, System.Single)
UnityEngine.Object.DestroyObject(UnityEngine.Object)
UnityEngine.Object.FindSceneObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfType<T>()
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectOfType<T>()
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
UnityEngine.Object.FindFirstObjectByType<T>()
UnityEngine.Object.FindAnyObjectByType<T>()
UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: TMPro
Syntax
[Serializable]
public class TMP_FontAsset : TMP_Asset
Fields
atlas
Declaration
[SerializeField]
public Texture2D atlas
Field Value
boldSpacing
Declaration
Field Value
Type |
Description |
System.Single |
|
boldStyle
Declaration
Field Value
Type |
Description |
System.Single |
|
fallbackFontAssets
List which contains the Fallback font assets for this font.
Declaration
[SerializeField]
public List<TMP_FontAsset> fallbackFontAssets
Field Value
fontAssetType
Declaration
public TMP_FontAsset.FontAssetTypes fontAssetType
Field Value
fontCreationSettings
Declaration
[SerializeField]
public FontCreationSetting fontCreationSettings
Field Value
fontWeights
Declaration
[SerializeField]
public TMP_FontWeights[] fontWeights
Field Value
italicStyle
Declaration
Field Value
Type |
Description |
System.Byte |
|
normalSpacingOffset
Declaration
public float normalSpacingOffset
Field Value
Type |
Description |
System.Single |
|
normalStyle
Declaration
Field Value
Type |
Description |
System.Single |
|
tabSize
Declaration
Field Value
Type |
Description |
System.Byte |
|
Properties
characterDictionary
Declaration
public Dictionary<int, TMP_Glyph> characterDictionary { get; }
Property Value
Type |
Description |
System.Collections.Generic.Dictionary<System.Int32, TMP_Glyph> |
|
defaultFontAsset
Default Font Asset used as last resort when glyphs are missing.
Declaration
public static TMP_FontAsset defaultFontAsset { get; }
Property Value
fontInfo
The general information about the font.
Declaration
public FaceInfo fontInfo { get; }
Property Value
kerningDictionary
Dictionary containing the kerning data
Declaration
public Dictionary<int, KerningPair> kerningDictionary { get; }
Property Value
Type |
Description |
System.Collections.Generic.Dictionary<System.Int32, KerningPair> |
|
kerningInfo
Declaration
public KerningTable kerningInfo { get; }
Property Value
Methods
AddFaceInfo(FaceInfo)
Declaration
public void AddFaceInfo(FaceInfo faceInfo)
Parameters
AddGlyphInfo(TMP_Glyph[])
Declaration
public void AddGlyphInfo(TMP_Glyph[] glyphInfo)
Parameters
AddKerningInfo(KerningTable)
Declaration
public void AddKerningInfo(KerningTable kerningTable)
Parameters
GetCharacters(TMP_FontAsset)
Function to extract all the characters from a font asset.
Declaration
public static string GetCharacters(TMP_FontAsset fontAsset)
Parameters
Returns
Type |
Description |
System.String |
|
GetCharactersArray(TMP_FontAsset)
Function which returns an array that contains all the characters from a font asset.
Declaration
public static int[] GetCharactersArray(TMP_FontAsset fontAsset)
Parameters
Returns
Type |
Description |
System.Int32[] |
|
HasCharacter(Char)
Function to check if a certain character exists in the font asset.
Declaration
public bool HasCharacter(char character)
Parameters
Type |
Name |
Description |
System.Char |
character |
|
Returns
Type |
Description |
System.Boolean |
|
HasCharacter(Char, Boolean)
Function to check if a character is contained in a font asset with the option to also check through fallback font assets.
Declaration
public bool HasCharacter(char character, bool searchFallbacks)
Parameters
Type |
Name |
Description |
System.Char |
character |
|
System.Boolean |
searchFallbacks |
|
Returns
Type |
Description |
System.Boolean |
|
HasCharacter(Int32)
Function to check if a certain character exists in the font asset.
Declaration
public bool HasCharacter(int character)
Parameters
Type |
Name |
Description |
System.Int32 |
character |
|
Returns
Type |
Description |
System.Boolean |
|
HasCharacters(String)
Function to check if certain characters exists in the font asset. Function returns false if any characters are missing.
Declaration
public bool HasCharacters(string text)
Parameters
Type |
Name |
Description |
System.String |
text |
String containing the characters to check
|
Returns
Type |
Description |
System.Boolean |
|
HasCharacters(String, out List<Char>)
Function to check if certain characters exists in the font asset. Function returns a list of missing characters.
Declaration
public bool HasCharacters(string text, out List<char> missingCharacters)
Parameters
Type |
Name |
Description |
System.String |
text |
|
System.Collections.Generic.List<System.Char> |
missingCharacters |
|
Returns
Type |
Description |
System.Boolean |
|
ReadFontDefinition()
Declaration
public void ReadFontDefinition()
SortGlyphs()
Function to sort the list of glyphs.
Declaration