Interface IFontHandle
Represents a reference counting handle for fonts.
Not intended for plugins to implement.
Assembly: Dalamud.dll
public interface IFontHandle : IDisposable
Properties
LoadException
Gets the load exception, if it failed to load. Otherwise, it is null.
Exception? LoadException { get; }
Available
Gets a value indicating whether this font is ready for use.
bool Available { get; }
Methods
TryLock(out string?)
Attempts to lock the fully constructed instance of Dalamud.Bindings.ImGui.ImFontPtr corresponding to the this
Dalamud.Interface.ManagedFontAtlas.IFontHandle, for use in any thread.
Modification of the font will exhibit undefined behavior if some other thread also uses the font.
ILockedImFont? TryLock(out string? errorMessage)
Returns
Dalamud.Interface.ManagedFontAtlas.ILockedImFont: An instance of Dalamud.Interface.ManagedFontAtlas.ILockedImFont that <b>must</b> be disposed after use on success;
null with <code class="paramref">errorMessage</code> populated on failure.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | errorMessage | The error message, if any. |
Lock()
Locks the fully constructed instance of Dalamud.Bindings.ImGui.ImFontPtr corresponding to the this
Dalamud.Interface.ManagedFontAtlas.IFontHandle, for use in any thread.
Modification of the font will exhibit undefined behavior if some other thread also uses the font.
ILockedImFont Lock()
Returns
Dalamud.Interface.ManagedFontAtlas.ILockedImFont: An instance of Dalamud.Interface.ManagedFontAtlas.ILockedImFont that <b>must</b> be disposed after use.
Exceptions
System.InvalidOperationException
If Dalamud.Interface.ManagedFontAtlas.IFontHandle.Available is false.
Push()
Pushes the current font into ImGui font stack, if available.
Use Dalamud.Bindings.ImGui.ImGui.GetFont to access the current font.
You may not access the font once you dispose this object.
IDisposable Push()
Returns
System.IDisposable: A disposable object that will pop the font on dispose.
Exceptions
System.InvalidOperationException
If called outside the main thread.
Pop()
Pops the font pushed to ImGui using Dalamud.Interface.ManagedFontAtlas.IFontHandle.Push(), cleaning up any extra information as needed.
void Pop()
WaitAsync()
Waits for Dalamud.Interface.ManagedFontAtlas.IFontHandle.Available to become true.
Task<IFontHandle> WaitAsync()
Returns
System.Threading.Tasks.Task<Dalamud.Interface.ManagedFontAtlas.IFontHandle>: A task containing this Dalamud.Interface.ManagedFontAtlas.IFontHandle.
WaitAsync(CancellationToken)
Waits for Dalamud.Interface.ManagedFontAtlas.IFontHandle.Available to become true.
Task<IFontHandle> WaitAsync(CancellationToken cancellationToken)
Returns
System.Threading.Tasks.Task<Dalamud.Interface.ManagedFontAtlas.IFontHandle>: A task containing this Dalamud.Interface.ManagedFontAtlas.IFontHandle.
Parameters
| Type | Name | Description |
|---|---|---|
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Events
ImFontChanged
Called when the built instance of Dalamud.Bindings.ImGui.ImFontPtr has been changed.
This event can be invoked outside the main thread.
event IFontHandle.ImFontChangedDelegate ImFontChanged
Event Type
Dalamud.Interface.ManagedFontAtlas.IFontHandle.ImFontChangedDelegate