Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

FontAsset

class in UnityEngine.TextCore.Text

/

Inherits from:ScriptableObject

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

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.

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.

Public 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 certain character exists in the font asset.
HasCharacters Function to check if certain characters exists in the font asset. Function returns a list of missing characters.
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.

Static Methods

Method Description
CreateFontAsset Creates a new font asset instance from the given family name and style.
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.

Inherited Members

Properties

PropertyDescription
hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameThe name of the object.

Public Methods

MethodDescription
GetEntityIdGets the EntityId of the object.
ToStringReturns the name of the object.

Static Methods

MethodDescription
DestroyRemoves a GameObject, component, or asset.
DestroyImmediateDestroys the specified object immediately. Use with caution and in Edit mode only.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindAnyObjectByTypeRetrieves any active loaded object of Type type.
FindObjectsByTypeRetrieves a list of all loaded objects of Type type.
InstantiateClones the object original and returns the clone.
InstantiateAsyncCaptures a snapshot of the original object (that must be related to some GameObject) and returns the AsyncInstantiateOperation.
CreateInstanceCreates an instance of a scriptable object.

Operators

OperatorDescription
boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.

Messages

MessageDescription
AwakeCalled when an instance of ScriptableObject is created.
OnDestroyThis function is called when the scriptable object will be destroyed.
OnDisableThis function is called when the scriptable object goes out of scope.
OnEnableThis function is called when the object is loaded.
OnValidateEditor-only function that Unity calls when the script is loaded or a value changes in the Inspector.
ResetReset to default values.