Version: 2023.1
LanguageEnglish
  • C#

FontEngine

class in UnityEngine.TextCore.LowLevel

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

The FontEngine is used to access data from source font files. This includes information about individual characters, glyphs and relevant metrics typically used in the process of text parsing, layout and rendering.

The types of font files supported are TrueType (.ttf, .ttc) and OpenType (.otf).

The FontEngine is also used to raster the visual representation of characters known as glyphs in a given font atlas texture.

Static Methods

DestroyFontEngineDestroy and unload resources used by the Font Engine.
GetFaceInfoGet the FaceInfo for the currently loaded and sized typeface.
GetFontFacesGets the font faces and styles for the currently loaded font.
GetSystemFontNamesGets the family and style names of the system fonts.
InitializeFontEngineInitialize the Font Engine and required resources.
LoadFontFaceLoad a source font file.
SetFaceSizeSet the size of the currently loaded font face.
TryGetGlyphIndexTry to get the glyph index for the character at the given Unicode value.
TryGetGlyphWithIndexValueTry loading the glyph for the given index value and if available populate the glyph.
TryGetGlyphWithUnicodeValueTry loading a glyph for the given unicode value. If available, populates the glyph and returns true. Otherwise returns false and populates the glyph with the .notdef / missing glyph data.
UnloadAllFontFacesUnloads all currently loaded font faces and removes them from the cache.
UnloadFontFaceUnloads current font face and removes it from the cache.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961