From 1a19cbf277a3e8d2a0dc079de4c12641bb9f7da2 Mon Sep 17 00:00:00 2001 From: Soreepeong Date: Sat, 20 Jan 2024 10:21:50 +0900 Subject: [PATCH] Set ImGui default font upon default font atlas update --- Dalamud/Interface/Internal/InterfaceManager.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Dalamud/Interface/Internal/InterfaceManager.cs b/Dalamud/Interface/Internal/InterfaceManager.cs index 94597f3da..8915b3e3d 100644 --- a/Dalamud/Interface/Internal/InterfaceManager.cs +++ b/Dalamud/Interface/Internal/InterfaceManager.cs @@ -717,6 +717,12 @@ internal class InterfaceManager : IDisposable, IServiceType // Fill missing glyphs in MonoFont from DefaultFont 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 this.AfterBuildFonts?.Invoke(); }); @@ -889,11 +895,8 @@ internal class InterfaceManager : IDisposable, IServiceType if (this.IsDispatchingEvents) { - using (this.defaultFontHandle?.Push()) - { - this.Draw?.Invoke(); - Service.Get().Draw(); - } + this.Draw?.Invoke(); + Service.Get().Draw(); } ImGuiManagedAsserts.ReportProblems("Dalamud Core", snap);