final class UIFonts
package smidr
Font + TextFormat cache for the library's TextFields.
register() points every widget at an embedded font asset; formats are cached per
(size, color, align) so text restyles never allocate. TextFields copy assigned formats
internally, so sharing cached instances is safe.
Static variables
Static methods
staticformat(size:Int, color:Int, ?align:TextFormatAlign):TextFormat
A cached TextFormat for the library font.
Parameters:
size | font size in px |
|---|---|
color | text color ( |
align | paragraph alignment (default LEFT) |
Returns:
the shared cached format — safe to assign, TextField copies it
staticinlinelibraryLoaded(id:String):Bool
Whether the asset library backing an id is loaded. A silent guard (no lime logging) so
callers can probe openfl.utils.Assets even when a project embeds no assets at all — an
unguarded Assets.exists/getX against a missing library spams
ERROR: There is no asset library named "default".
Parameters:
id | an asset path, optionally |
|---|
Returns:
true when the referenced library exists
staticmake(size:Int, color:Int, ?align:TextFormatAlign):TextField
Builds a non-interactive single-line auto-sizing TextField in the library font.
Parameters:
size | font size in px |
|---|---|
color | text color |
align | paragraph alignment (default LEFT) |
Returns:
the configured field (mouse-transparent, not selectable)
staticregister(assetPath:String):Bool
Loads an embedded font asset and makes it the library font.
Parameters:
assetPath | the embedded font asset (e.g. |
|---|
Returns:
true when the font was found and applied
staticinlinerestyle(tf:TextField, size:Int, color:Int, ?align:TextFormatAlign):Void
Restyles an existing field with a cached format (applies to current and future text).
Parameters:
tf | the field to restyle |
|---|---|
size | font size in px |
color | text color |
align | paragraph alignment (default LEFT) |