![]() |
Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
|
Centralized manager for loading, retrieving, and unloading shared fonts. Fonts are stored by string key and reused across the application. More...
Public Member Functions | |
| SKTypeface | LoadFromFile (string key, string filePath) |
| Loads a font from a file path and stores it under the given key. If the key already exists, the old font is disposed and replaced. | |
| SKTypeface | LoadFromResource (string key, Assembly assembly, string resourceName) |
| Loads a font from an embedded resource in the specified assembly and stores it under the given key. If the key already exists, the old font is disposed and replaced. | |
| SKTypeface | LoadFromResource (string key, string resourceName) |
| Loads a font from an embedded resource in the calling assembly and stores it under the given key. If the key already exists, the old font is disposed and replaced. | |
| SKTypeface | Get (string key) |
| Gets a font by key. | |
| bool | TryGet (string key, out SKTypeface? typeface) |
| Tries to get a font by key. | |
| SKTypeface | GetOrDefault (string key) |
| Retrieves the typeface associated with the specified key, or returns the default typeface if the key is not found or is null or whitespace. | |
| bool | Contains (string key) |
| Returns true if a font exists for the given key. | |
| bool | Remove (string key) |
| Removes a single font entry by key and disposes the stored typeface. | |
| void | Clear () |
| Disposes all loaded fonts and clears the manager. | |
| void | Dispose () |
| Disposes all loaded fonts managed by this instance and prevents further use. | |
Properties | |
| static FontManager | Instance [get] |
| Gets the singleton instance of the FontManager. | |
| IReadOnlyCollection< string > | Keys [get] |
| Gets all currently registered font keys. | |
Centralized manager for loading, retrieving, and unloading shared fonts. Fonts are stored by string key and reused across the application.
Definition at line 10 of file FontManager.cs.
| void Gondwana.Rendering.Text.FontManager.Clear | ( | ) |
Disposes all loaded fonts and clears the manager.
Definition at line 198 of file FontManager.cs.
| bool Gondwana.Rendering.Text.FontManager.Contains | ( | string | key | ) |
Returns true if a font exists for the given key.
| key | The lookup key for the resource. |
true if a player is registered for the key; otherwise, false.Definition at line 165 of file FontManager.cs.
| void Gondwana.Rendering.Text.FontManager.Dispose | ( | ) |
Disposes all loaded fonts managed by this instance and prevents further use.
Definition at line 242 of file FontManager.cs.
| SKTypeface Gondwana.Rendering.Text.FontManager.Get | ( | string | key | ) |
Gets a font by key.
| key | Logical name of the font. |
| KeyNotFoundException | Thrown when the key does not exist. |
Definition at line 108 of file FontManager.cs.
| SKTypeface Gondwana.Rendering.Text.FontManager.GetOrDefault | ( | string | key | ) |
Retrieves the typeface associated with the specified key, or returns the default typeface if the key is not found or is null or whitespace.
| key | The key used to identify the desired typeface. If null, empty, or consists only of whitespace, the default typeface is returned. |
Definition at line 148 of file FontManager.cs.
| SKTypeface Gondwana.Rendering.Text.FontManager.LoadFromFile | ( | string | key, |
| string | filePath ) |
Loads a font from a file path and stores it under the given key. If the key already exists, the old font is disposed and replaced.
| key | Logical name for the font. |
| filePath | Path to the font file. |
| ArgumentException | Thrown when key or filePath is invalid. |
| InvalidOperationException | Thrown when the font could not be loaded. |
Definition at line 36 of file FontManager.cs.
| SKTypeface Gondwana.Rendering.Text.FontManager.LoadFromResource | ( | string | key, |
| Assembly | assembly, | ||
| string | resourceName ) |
Loads a font from an embedded resource in the specified assembly and stores it under the given key. If the key already exists, the old font is disposed and replaced.
| key | Logical name for the font. |
| assembly | Assembly containing the embedded font resource. |
| resourceName | Fully qualified embedded resource name. |
| ArgumentException | Thrown when arguments are invalid. |
| InvalidOperationException | Thrown when the resource is missing or the font could not be loaded. |
Definition at line 64 of file FontManager.cs.
| SKTypeface Gondwana.Rendering.Text.FontManager.LoadFromResource | ( | string | key, |
| string | resourceName ) |
Loads a font from an embedded resource in the calling assembly and stores it under the given key. If the key already exists, the old font is disposed and replaced.
| key | The lookup key for the resource. |
| resourceName | The resource name. |
Definition at line 97 of file FontManager.cs.
| bool Gondwana.Rendering.Text.FontManager.Remove | ( | string | key | ) |
Removes a single font entry by key and disposes the stored typeface.
| key | Logical name of the font. |
Definition at line 180 of file FontManager.cs.
| bool Gondwana.Rendering.Text.FontManager.TryGet | ( | string | key, |
| out SKTypeface? | typeface ) |
Tries to get a font by key.
| key | The lookup key for the resource. |
| typeface | The typeface used to render text. |
true if the player was found; otherwise, false.Definition at line 127 of file FontManager.cs.
|
staticget |
Gets the singleton instance of the FontManager.
Definition at line 20 of file FontManager.cs.
|
get |
Gets all currently registered font keys.
Definition at line 211 of file FontManager.cs.