Merge pull request #1617 from Soreepeong/fix/ifontatlas-defaultfont

Set ImGui default font upon default font atlas update
This commit is contained in:
goat 2024-01-20 10:16:29 +01:00 committed by GitHub
commit 11c1b4658b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -717,6 +717,12 @@ internal class InterfaceManager : IDisposable, IServiceType
// Fill missing glyphs in MonoFont from DefaultFont // Fill missing glyphs in MonoFont from DefaultFont
tk.CopyGlyphsAcrossFonts(this.defaultFontHandle.ImFont, this.monoFontHandle.ImFont, true); tk.CopyGlyphsAcrossFonts(this.defaultFontHandle.ImFont, this.monoFontHandle.ImFont, true);
// Update default font
unsafe
{
ImGui.GetIO().NativePtr->FontDefault = this.defaultFontHandle.ImFont;
}
// Broadcast to auto-rebuilding instances // Broadcast to auto-rebuilding instances
this.AfterBuildFonts?.Invoke(); this.AfterBuildFonts?.Invoke();
}); });
@ -888,13 +894,10 @@ internal class InterfaceManager : IDisposable, IServiceType
var snap = ImGuiManagedAsserts.GetSnapshot(); var snap = ImGuiManagedAsserts.GetSnapshot();
if (this.IsDispatchingEvents) if (this.IsDispatchingEvents)
{
using (this.defaultFontHandle?.Push())
{ {
this.Draw?.Invoke(); this.Draw?.Invoke();
Service<NotificationManager>.Get().Draw(); Service<NotificationManager>.Get().Draw();
} }
}
ImGuiManagedAsserts.ReportProblems("Dalamud Core", snap); ImGuiManagedAsserts.ReportProblems("Dalamud Core", snap);
} }