UiFontAsset
- Namespace: Turian.Engine.UI
- Source File: UiFontAsset.cs
Asset metadata for a UI font (.ttf / .otf). GetContent reads the imported file and loads it as a Guinevere Font at a default size; callers set the point size with WithSize. Loaded faces are cached per asset id.
Public Methods
GetContent
public Font? GetContent()
Reads this font's artifact and returns a base Font, or null.
Returns: Font?
InvalidateCacheEntry
public static void InvalidateCacheEntry(Guid assetId)
Drops the cached font for assetId.
Parameters:
assetId(Guid): The font asset id.
ClearCache
public static void ClearCache()
Clears every cached font. Call on project unload.
LoadContent
public static Font LoadContent(string absolutePath)
Loads a font file directly from disk. Used by tooling and tests.
Parameters:
absolutePath(string): Absolute path of the.ttf/.otffile.
Returns: Font