Skip to main content

Interface IFontHandle

Represents a reference counting handle for fonts.

Not intended for plugins to implement.

Assembly: Dalamud.dll
View Source
Declaration
public interface IFontHandle : IDisposable

Properties

LoadException

Gets the load exception, if it failed to load. Otherwise, it is null.

View Source
Declaration
Exception? LoadException { get; }

Available

Gets a value indicating whether this font is ready for use.

View Source
Declaration
bool Available { get; }

Methods

Lock()

Locks the fully constructed instance of ImGuiNET.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.

View Source
Declaration
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 ImGuiNET.ImGui.GetFont() to access the current font.

You may not access the font once you dispose this object.

View Source
Declaration
IDisposable Push()
Returns

System.IDisposable: A disposable object that will pop the font on dispose.

Exceptions

System.InvalidOperationException
If called outside of the main thread.

Pop()

Pops the font pushed to ImGui using Dalamud.Interface.ManagedFontAtlas.IFontHandle.Push(), cleaning up any extra information as needed.

View Source
Declaration
void Pop()

WaitAsync()

Waits for Dalamud.Interface.ManagedFontAtlas.IFontHandle.Available to become true.

View Source
Declaration
Task<IFontHandle> WaitAsync()
Returns

System.Threading.Tasks.Task<Dalamud.Interface.ManagedFontAtlas.IFontHandle>: A task containing this Dalamud.Interface.ManagedFontAtlas.IFontHandle.## Events

ImFontChanged

Called when the built instance of ImGuiNET.ImFontPtr has been changed.

This event can be invoked outside the main thread.

View Source
Declaration
event IFontHandle.ImFontChangedDelegate ImFontChanged
Event Type

Dalamud.Interface.ManagedFontAtlas.IFontHandle.ImFontChangedDelegate