Class TMP_FontAsset
image/svg+xml
docs.unity.cn
  • Manual
  • Scripting API
  • Changelog
  • License
    Show / Hide Table of Contents
    • TMPro
      • _Horizontal​Alignment​Options
      • _Vertical​Alignment​Options
      • Caret​Info
      • Caret​Position
      • Compute_Distance​Transform_Event​Types
      • Compute_DT_Event​Args
      • Extents
      • Face​Info
      • Fast​Action
      • Fast​Action<A, B, C>
      • Fast​Action<A, B>
      • Fast​Action<A>
      • Font​Creation​Setting
      • Font​Styles
      • Font​Weights
      • Glyph​Value​Record
      • IText​Element
      • Kerning​Pair
      • Kerning​Pair​Key
      • Kerning​Table
      • Masking​Offset​Mode
      • Masking​Types
      • Material​Reference
      • Material​Reference​Manager
      • Mesh_Extents
      • Shader​Utilities
      • Sorting​Layer​Helper
      • Tag​Attribute
      • Tag​Type
      • Tag​Units
      • Text​Alignment​Options
      • Text​Container
      • Text​Container​Anchors
      • Text​Mesh​Pro
      • Text​Mesh​Pro​UGUI
      • Text​Overflow​Modes
      • Text​Render​Flags
      • Texture​Mapping​Options
      • TMP_Asset
      • TMP_Basic​Xml​Tag​Stack
      • TMP_Character​Info
      • TMP_Color​Gradient
      • TMP_Compatibility
      • TMP_Compatibility.​Anchor​Positions
      • TMP_Default​Controls
      • TMP_Default​Controls.​Resources
      • TMP_Dropdown
      • TMP_Dropdown.​Dropdown​Event
      • TMP_Dropdown.​Dropdown​Item
      • TMP_Dropdown.​Option​Data
      • TMP_Dropdown.​Option​Data​List
      • TMP_Editor​Tests
      • TMP_Font​Asset
      • TMP_Font​Asset.​Font​Asset​Types
      • TMP_Font​Utilities
      • TMP_Font​Weights
      • TMP_Glyph
      • TMP_Input​Field
      • TMP_Input​Field.​Character​Validation
      • TMP_Input​Field.​Content​Type
      • TMP_Input​Field.​Edit​State
      • TMP_Input​Field.​Input​Type
      • TMP_Input​Field.​Line​Type
      • TMP_Input​Field.​On​Change​Event
      • TMP_Input​Field.​On​Validate​Input
      • TMP_Input​Field.​Selection​Event
      • TMP_Input​Field.​Submit​Event
      • TMP_Input​Field.​Text​Selection​Event
      • TMP_Input​Validator
      • TMP_Line​Info
      • TMP_Link​Info
      • TMP_Material​Manager
      • TMP_Math
      • TMP_Mesh​Info
      • TMP_Package​Utilities
      • TMP_Page​Info
      • TMP_Post​Build​Process​Handler
      • TMP_Project​Conversion​Utility
      • TMP_Project​Text​Settings
      • TMP_Runtime​Tests
      • TMP_Scrollbar​Event​Handler
      • TMP_Selection​Caret
      • TMP_Settings
      • TMP_Settings.​Line​Breaking​Table
      • TMP_Sprite
      • TMP_Sprite​Animator
      • TMP_Sprite​Asset
      • TMP_Sprite​Asset​Importer
      • TMP_Sprite​Info
      • TMP_Style
      • TMP_Style​Sheet
      • TMP_Sub​Mesh
      • TMP_Sub​Mesh​UI
      • TMP_Text
      • TMP_Text.​Text​Input​Sources
      • TMP_Text​Element
      • TMP_Text​Element​Type
      • TMP_Text​Info
      • TMP_Text​Utilities
      • TMP_Update​Manager
      • TMP_Update​Registry
      • TMP_Vertex
      • TMP_Vertex​Data​Update​Flags
      • TMP_Word​Info
      • TMP_Xml​Tag​Stack<T>
      • TMPro_Event​Manager
      • TMPro_Extension​Methods
      • Vertex​Gradient
      • Vertex​Sorting​Order
      • Word​Wrap​State
      • XML_Tag​Attribute
    • TMPro.​Editor​Utilities
      • Dropdown​Editor
      • Editor​Coroutine
      • Editor​Shader​Utilities
      • Face​Styles
      • Font​Weight​Drawer
      • FT_Face​Info
      • FT_Glyph​Info
      • FT_Kerning​Pair
      • Glyph​Info​Drawer
      • Kerning​Pair​Drawer
      • Render​Modes
      • Sprite​Info​Drawer
      • Style​Drawer
      • TMP_Base​Shader​GUI
      • TMP_Base​Shader​GUI.​Material​Panel
      • TMP_Base​Shader​GUI.​Shader​Feature
      • TMP_Bitmap​Shader​GUI
      • TMP_Color​Gradient​Asset​Menu
      • TMP_Color​Gradient​Editor
      • TMP_Context​Menus
      • TMP_Editor​Panel
      • TMP_Editor​Utility
      • TMP_Font​Asset​Editor
      • TMP_Input​Field​Editor
      • TMP_SDFShader​GUI
      • TMP_Settings​Editor
      • TMP_Sprite​Asset​Editor
      • TMP_Sprite​Asset​Menu
      • TMP_Style​Asset​Menu
      • TMP_Style​Editor
      • TMP_Sub​Mesh_Editor
      • TMP_Sub​Mesh​UI_Editor
      • TMP_Ui​Editor​Panel
      • TMP_UIStyle​Manager
      • TMPro_Create​Object​Menu
      • TMPro_Font​Asset​Creator​Window
      • TMPro_Font​Plugin
      • TMPro_Text​Container​Editor
      • TMPro_Texture​Post​Processor
    • TMPro.​Sprite​Asset​Utilities
      • Sprite​Asset​Import​Formats
      • Texture​Packer
      • Texture​Packer.​Sprite​Data
      • Texture​Packer.​Sprite​Data​Object
      • Texture​Packer.​Sprite​Frame
      • Texture​Packer.​Sprite​Size
    • Scripting API
    • TMPro
    • TMP_Font​Asset

    Class TMP_FontAsset

    Inheritance
    Object
    TMP_Asset
    TMP_FontAsset
    Inherited Members
    TMP_Asset.hashCode
    TMP_Asset.material
    TMP_Asset.materialHashCode
    Namespace: TMPro
    Syntax
    [Serializable]
    public class TMP_FontAsset : TMP_Asset

    Fields

    atlas

    Declaration
    public Texture2D atlas
    Field Value
    Type Description
    Texture2D

    boldSpacing

    Declaration
    public float boldSpacing
    Field Value
    Type Description
    Single

    boldStyle

    Declaration
    public float boldStyle
    Field Value
    Type Description
    Single

    fallbackFontAssets

    List which contains the Fallback font assets for this font.

    Declaration
    public List<TMP_FontAsset> fallbackFontAssets
    Field Value
    Type Description
    List<TMP_FontAsset>

    fontAssetType

    Declaration
    public TMP_FontAsset.FontAssetTypes fontAssetType
    Field Value
    Type Description
    TMP_FontAsset.FontAssetTypes

    fontCreationSettings

    Declaration
    public FontCreationSetting fontCreationSettings
    Field Value
    Type Description
    FontCreationSetting

    fontWeights

    Declaration
    public TMP_FontWeights[] fontWeights
    Field Value
    Type Description
    TMP_FontWeights[]

    italicStyle

    Declaration
    public byte italicStyle
    Field Value
    Type Description
    Byte

    normalSpacingOffset

    Declaration
    public float normalSpacingOffset
    Field Value
    Type Description
    Single

    normalStyle

    Declaration
    public float normalStyle
    Field Value
    Type Description
    Single

    tabSize

    Declaration
    public byte tabSize
    Field Value
    Type Description
    Byte

    Properties

    characterDictionary

    Declaration
    public Dictionary<int, TMP_Glyph> characterDictionary { get; }
    Property Value
    Type Description
    Dictionary<Int32, TMP_Glyph>

    defaultFontAsset

    Default Font Asset used as last resort when glyphs are missing.

    Declaration
    public static TMP_FontAsset defaultFontAsset { get; }
    Property Value
    Type Description
    TMP_FontAsset

    fontInfo

    The general information about the font.

    Declaration
    public FaceInfo fontInfo { get; }
    Property Value
    Type Description
    FaceInfo

    kerningDictionary

    Dictionary containing the kerning data

    Declaration
    public Dictionary<int, KerningPair> kerningDictionary { get; }
    Property Value
    Type Description
    Dictionary<Int32, KerningPair>

    kerningInfo

    Declaration
    public KerningTable kerningInfo { get; }
    Property Value
    Type Description
    KerningTable

    Methods

    AddFaceInfo(FaceInfo)

    Declaration
    public void AddFaceInfo(FaceInfo faceInfo)
    Parameters
    Type Name Description
    FaceInfo faceInfo

    AddGlyphInfo(TMP_Glyph[])

    Declaration
    public void AddGlyphInfo(TMP_Glyph[] glyphInfo)
    Parameters
    Type Name Description
    TMP_Glyph[] glyphInfo

    AddKerningInfo(KerningTable)

    Declaration
    public void AddKerningInfo(KerningTable kerningTable)
    Parameters
    Type Name Description
    KerningTable kerningTable

    GetCharacters(TMP_FontAsset)

    Function to extract all the characters from a font asset.

    Declaration
    public static string GetCharacters(TMP_FontAsset fontAsset)
    Parameters
    Type Name Description
    TMP_FontAsset fontAsset
    Returns
    Type Description
    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
    Type Name Description
    TMP_FontAsset fontAsset
    Returns
    Type Description
    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
    Char character
    Returns
    Type Description
    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
    Char character
    Boolean searchFallbacks
    Returns
    Type Description
    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
    Int32 character
    Returns
    Type Description
    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
    String text

    String containing the characters to check

    Returns
    Type Description
    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
    String text
    List<Char> missingCharacters
    Returns
    Type Description
    Boolean

    ReadFontDefinition()

    Declaration
    public void ReadFontDefinition()

    SortGlyphs()

    Function to sort the list of glyphs.

    Declaration
    public void SortGlyphs()
    In This Article
    • Fields
      • atlas
      • boldSpacing
      • boldStyle
      • fallbackFontAssets
      • fontAssetType
      • fontCreationSettings
      • fontWeights
      • italicStyle
      • normalSpacingOffset
      • normalStyle
      • tabSize
    • Properties
      • characterDictionary
      • defaultFontAsset
      • fontInfo
      • kerningDictionary
      • kerningInfo
    • Methods
      • AddFaceInfo(FaceInfo)
      • AddGlyphInfo(TMP_Glyph[])
      • AddKerningInfo(KerningTable)
      • GetCharacters(TMP_FontAsset)
      • GetCharactersArray(TMP_FontAsset)
      • HasCharacter(Char)
      • HasCharacter(Char, Boolean)
      • HasCharacter(Int32)
      • HasCharacters(String)
      • HasCharacters(String, out List<Char>)
      • ReadFontDefinition()
      • SortGlyphs()
    Back to top Copyright © 2019 Unity Technologies
    Generated by DocFX