Interface IFontAtlas
Wrapper for ImGuiNET.ImFontAtlasPtr.
Not intended for plugins to implement.
Assembly: Dalamud.dll
View Source
public interface IFontAtlas : IDisposable
Properties
Name
Gets the name of the atlas. For logging and debugging purposes.
View Source
string Name { get; }
AutoRebuildMode
Gets a value how the atlas should be rebuilt when the relevant Dalamud Configuration changes.
View Source
FontAtlasAutoRebuildMode AutoRebuildMode { get; }
ImAtlas
Gets the font atlas. Might be empty.
View Source
ImFontAtlasPtr ImAtlas { get; }
BuildTask
Gets the task that represents the current font rebuild state.
View Source
Task BuildTask { get; }
HasBuiltAtlas
Gets a value indicating whether there exists any built atlas, regardless of Dalamud.Interface.ManagedFontAtlas.IFontAtlas.BuildTask.
View Source
bool HasBuiltAtlas { get; }
IsGlobalScaled
Gets a value indicating whether this font atlas is under the effect of global scale.
View Source
bool IsGlobalScaled { get; }
Methods
SuppressAutoRebuild()
Suppresses automatically rebuilding fonts for the scope.
View Source
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
IFontHandle NewGameFontHandle(GameFontStyle style)
Returns
Dalamud.Interface.ManagedFontAtlas.IFontHandle: Handle to a font that may or may not be ready yet.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Interface.GameFonts.GameFontStyle | style | Font 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
IFontHandle NewDelegateFontHandle(FontAtlasBuildStepDelegate buildStepDelegate)
Returns
Dalamud.Interface.ManagedFontAtlas.IFontHandle: Handle to a font that may or may not be ready yet.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Interface.ManagedFontAtlas.FontAtlasBuildStepDelegate | buildStepDelegate | Callback 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
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
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
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
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
event Action? RebuildRecommend
Event Type
System.Action