Skip to main content

Interface IFontAtlas

Wrapper for ImGuiNET.ImFontAtlasPtr.

Not intended for plugins to implement.

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

Properties

Name

Gets the name of the atlas. For logging and debugging purposes.

View Source
Declaration
string Name { get; }

AutoRebuildMode

Gets a value how the atlas should be rebuilt when the relevant Dalamud Configuration changes.

View Source
Declaration
FontAtlasAutoRebuildMode AutoRebuildMode { get; }

ImAtlas

Gets the font atlas. Might be empty.

View Source
Declaration
ImFontAtlasPtr ImAtlas { get; }

BuildTask

Gets the task that represents the current font rebuild state.

View Source
Declaration
Task BuildTask { get; }

HasBuiltAtlas

Gets a value indicating whether there exists any built atlas, regardless of Dalamud.Interface.ManagedFontAtlas.IFontAtlas.BuildTask.

View Source
Declaration
bool HasBuiltAtlas { get; }

IsGlobalScaled

Gets a value indicating whether this font atlas is under the effect of global scale.

View Source
Declaration
bool IsGlobalScaled { get; }

Methods

SuppressAutoRebuild()

Suppresses automatically rebuilding fonts for the scope.

View Source
Declaration
IDisposable SuppressAutoRebuild()
Returns

System.IDisposable: An instance of System.IDisposable that will release the suppression.### NewGameFontHandle(GameFontStyle) Creates a new Dalamud.Interface.ManagedFontAtlas.IFontHandle from game's built-in fonts.

View Source
Declaration
IFontHandle NewGameFontHandle(GameFontStyle style)
Returns

Dalamud.Interface.ManagedFontAtlas.IFontHandle: Handle to a font that may or may not be ready yet.

Parameters
TypeNameDescription
Dalamud.Interface.GameFonts.GameFontStylestyleFont to use.
Exceptions

System.InvalidOperationException
When called during Dalamud.Interface.ManagedFontAtlas.IFontAtlas.BuildStepChange and alike. Move the font handle creating code outside those handlers, and only initialize them once. Call System.IDisposable.Dispose on a previous font handle if you're replacing one.

NewDelegateFontHandle(FontAtlasBuildStepDelegate)

Creates a new IFontHandle using your own callbacks.

View Source
Declaration
IFontHandle NewDelegateFontHandle(FontAtlasBuildStepDelegate buildStepDelegate)
Returns

Dalamud.Interface.ManagedFontAtlas.IFontHandle: Handle to a font that may or may not be ready yet.

Parameters
TypeNameDescription
Dalamud.Interface.ManagedFontAtlas.FontAtlasBuildStepDelegatebuildStepDelegateCallback for Dalamud.Interface.ManagedFontAtlas.IFontAtlas.BuildStepChange.
Exceptions

System.InvalidOperationException
When called during Dalamud.Interface.ManagedFontAtlas.IFontAtlas.BuildStepChange and alike. Move the font handle creating code outside those handlers, and only initialize them once. Call System.IDisposable.Dispose on a previous font handle if you're replacing one.

BuildFontsOnNextFrame()

Queues rebuilding fonts, on the main thread.

Note that Dalamud.Interface.ManagedFontAtlas.IFontAtlas.BuildTask would not necessarily get changed from calling this function.

View Source
Declaration
void BuildFontsOnNextFrame()
Exceptions

System.InvalidOperationException
If Dalamud.Interface.ManagedFontAtlas.IFontAtlas.AutoRebuildMode is Dalamud.Interface.ManagedFontAtlas.FontAtlasAutoRebuildMode.Async.

BuildFontsImmediately()

Rebuilds fonts immediately, on the current thread.

View Source
Declaration
void BuildFontsImmediately()
Exceptions

System.InvalidOperationException
If Dalamud.Interface.ManagedFontAtlas.IFontAtlas.AutoRebuildMode is Dalamud.Interface.ManagedFontAtlas.FontAtlasAutoRebuildMode.Async.

BuildFontsAsync()

Rebuilds fonts asynchronously, on any thread.

View Source
Declaration
Task BuildFontsAsync()
Returns

System.Threading.Tasks.Task: The task.

Exceptions

System.InvalidOperationException
If Dalamud.Interface.ManagedFontAtlas.IFontAtlas.AutoRebuildMode is Dalamud.Interface.ManagedFontAtlas.FontAtlasAutoRebuildMode.OnNewFrame.

Events

BuildStepChange

Event to be called on build step changes.

Dalamud.Interface.ManagedFontAtlas.IFontAtlasBuildToolkit.Font is meaningless for this event.

View Source
Declaration
event FontAtlasBuildStepDelegate? BuildStepChange
Event Type

Dalamud.Interface.ManagedFontAtlas.FontAtlasBuildStepDelegate

RebuildRecommend

Event fired when a font rebuild operation is recommended.

This event will be invoked from the main thread.

Reasons for the event include changes in Dalamud.Interface.Utility.ImGuiHelpers.GlobalScale and initialization of new associated font handles.

View Source
Declaration
event Action? RebuildRecommend
Event Type

System.Action