FontAsset
Contains deprecated FontAsset APIs that are being phased out as ATG (Advanced Text Generator) becomes the primary text backend. These APIs are no longer required for ATG-based text rendering.
Read time 6 minutesLast updated 8 days ago
Definition
- Type: Class
- Namespace: UnityEngine.TextCore.Text
- Assembly: UnityEngine.TextCoreTextEngineModule
- Inherits from: TextAsset
[HelpURL("UIE-font-asset-landing")]public class FontAsset : TextAsset
Properties
Property | Description |
|---|---|
| atlasHeight | The height of the atlas texture(s) used by this font asset. |
| atlasPadding | The padding used between glyphs contained in the atlas texture(s) used by this font asset. |
| atlasTexture | The font atlas used by this font asset. This is always the texture at index [0] of the fontAtlasTextures. |
| atlasTextureCount | Number of atlas textures used by this font asset. |
| atlasTextures | Array of atlas textures that contain the glyphs used by this font asset. |
| atlasWidth | The width of the atlas texture(s) used by this font asset. |
| boldStyleSpacing | The spacing between characters when using regular style. |
| boldStyleWeight | Defines the dilation of the text when using bold style. |
| faceInfo | Information about the font's face. |
| fallbackFontAssetTable | List containing the Fallback font assets for this font. |
| fontAssetCreationEditorSettings | The settings used in the Font Asset Creator when this font asset was created or edited. |
| fontWeightTable | Array containing font assets to be used as alternative typefaces for the various potential font weights of this font asset. |
| getFontFeatures | Determines if OpenType font features should be retrieved from the source font file as new characters and glyphs are added dynamically to the font asset. |
| isMultiAtlasTexturesEnabled | Enables the font asset to create additional atlas textures as needed. |
| italicStyleSlant | Defines the slant of the text when using italic style. |
| regularStyleSpacing | The spacing between characters when using regular style. |
| regularStyleWeight | Defines the dilation of the text when using regular style. |
| sourceFontFile | Source font file when atlas population mode is set to dynamic. Null when the atlas population mode is set to static. |
| tabMultiple | The number of spaces that a tab represents. |
Methods
Method | Description |
|---|---|
| ClearFontAssetData | Clears font asset data including the glyph and character tables and textures. Function might be changed to Internal and only used in tests. |
| HasCharacter | Function to check if a character is contained in the font asset with the option to also check potential local fallbacks. |
| HasCharacters | Function to check if certain characters exists in the font asset. Function returns false if any characters are missing. |
| ReadFontAssetDefinition | Reads the various data tables of the font asset and populates various data structures to allow for faster lookup of related font asset data. |
| TryAddCharacters | Try adding the characters from the provided string to the font asset. |
| TryGetGlyphIndex | Tries to get the index of the glyph mapped to the given Unicode code point in the font asset's source font. |
| TryGetGlyphMetrics | Tries to get the metrics of the glyph at the given glyph index. |
Static Methods
Method | Description |
|---|---|
| CreateFontAsset | Creates a new font asset instance from the font file at the given file path. |
| GetCharacters | Function to extract all the characters from a font asset. |
| GetCharactersArray | Function which returns an array that contains all the characters from a font asset. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |