From db63e71f13eac9fa9350baedaaef6552ecae7ed5 Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 12 Jan 2018 20:07:01 +0100 Subject: [PATCH] Internals: Exposed SetCurrentFont() in imgui_internal.h --- imgui.cpp | 3 +-- imgui_internal.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 755d49f8d..57b24157c 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -674,7 +674,6 @@ static bool IsKeyPressedMap(ImGuiKey key, bool repeat = true); static ImFont* GetDefaultFont(); -static void SetCurrentFont(ImFont* font); static void SetCurrentWindow(ImGuiWindow* window); static void SetWindowScrollX(ImGuiWindow* window, float new_scroll_x); static void SetWindowScrollY(ImGuiWindow* window, float new_scroll_y); @@ -6220,7 +6219,7 @@ static ImFont* GetDefaultFont() return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; } -static void SetCurrentFont(ImFont* font) +void ImGui::SetCurrentFont(ImFont* font) { ImGuiContext& g = *GImGui; IM_ASSERT(font && font->IsLoaded()); // Font Atlas not created. Did you call io.Fonts->GetTexDataAsRGBA32 / GetTexDataAsAlpha8 ? diff --git a/imgui_internal.h b/imgui_internal.h index 8f4ecc206..2d6ec52ba 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -996,6 +996,8 @@ namespace ImGui IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled); IMGUI_API void PopItemFlag(); + IMGUI_API void SetCurrentFont(ImFont* font); + IMGUI_API void OpenPopupEx(ImGuiID id); IMGUI_API void ClosePopup(ImGuiID id); IMGUI_API bool IsPopupOpen(ImGuiID id);