Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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

[HelpURL("UIE-font-asset-landing")]public class FontAsset : TextAsset

Properties

Property

Description

atlasHeightThe height of the atlas texture(s) used by this font asset.
atlasPaddingThe padding used between glyphs contained in the atlas texture(s) used by this font asset.
atlasTextureThe font atlas used by this font asset. This is always the texture at index [0] of the fontAtlasTextures.
atlasTextureCountNumber of atlas textures used by this font asset.
atlasTexturesArray of atlas textures that contain the glyphs used by this font asset.
atlasWidthThe width of the atlas texture(s) used by this font asset.
boldStyleSpacingThe spacing between characters when using regular style.
boldStyleWeightDefines the dilation of the text when using bold style.
faceInfoInformation about the font's face.
fallbackFontAssetTableList containing the Fallback font assets for this font.
fontAssetCreationEditorSettingsThe settings used in the Font Asset Creator when this font asset was created or edited.
fontWeightTableArray containing font assets to be used as alternative typefaces for the various potential font weights of this font asset.
getFontFeaturesDetermines if OpenType font features should be retrieved from the source font file as new characters and glyphs are added dynamically to the font asset.
isMultiAtlasTexturesEnabledEnables the font asset to create additional atlas textures as needed.
italicStyleSlantDefines the slant of the text when using italic style.
regularStyleSpacingThe spacing between characters when using regular style.
regularStyleWeightDefines the dilation of the text when using regular style.
sourceFontFileSource font file when atlas population mode is set to dynamic. Null when the atlas population mode is set to static.
tabMultipleThe number of spaces that a tab represents.

Methods

Method

Description

ClearFontAssetDataClears font asset data including the glyph and character tables and textures. Function might be changed to Internal and only used in tests.
HasCharacterFunction to check if a character is contained in the font asset with the option to also check potential local fallbacks.
HasCharactersFunction to check if certain characters exists in the font asset. Function returns false if any characters are missing.
ReadFontAssetDefinitionReads the various data tables of the font asset and populates various data structures to allow for faster lookup of related font asset data.
TryAddCharactersTry adding the characters from the provided string to the font asset.
TryGetGlyphIndexTries to get the index of the glyph mapped to the given Unicode code point in the font asset's source font.
TryGetGlyphMetricsTries to get the metrics of the glyph at the given glyph index.

Static Methods

Method

Description

CreateFontAssetCreates a new font asset instance from the font file at the given file path.
GetCharactersFunction to extract all the characters from a font asset.
GetCharactersArrayFunction which returns an array that contains all the characters from a font asset.

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.