From 582c77b60490cac95e6dccf89540890df0560553 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin <stenzek@gmail.com> Date: Mon, 11 Jan 2021 00:56:59 +1000 Subject: [PATCH] ImGuiStyle: Return the font we create --- src/frontend-common/imgui_styles.cpp | 6 +++--- src/frontend-common/imgui_styles.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontend-common/imgui_styles.cpp b/src/frontend-common/imgui_styles.cpp index bcfefe851..3fd951615 100644 --- a/src/frontend-common/imgui_styles.cpp +++ b/src/frontend-common/imgui_styles.cpp @@ -57,7 +57,7 @@ void ImGui::StyleColorsDarker(ImGuiStyle* dst) #include "font_roboto_regular.inl" -void ImGui::AddRobotoRegularFont(float size /*= 15.0f*/) +ImFont* ImGui::AddRobotoRegularFont(float size /*= 15.0f*/) { static const ImWchar ranges[] = { // Basic Latin + Latin Supplement + Central European diacritics @@ -79,6 +79,6 @@ void ImGui::AddRobotoRegularFont(float size /*= 15.0f*/) 0, }; - ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(s_font_roboto_regular_compressed_data, - s_font_roboto_regular_compressed_size, size, nullptr, ranges); + return ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF( + s_font_roboto_regular_compressed_data, s_font_roboto_regular_compressed_size, size, nullptr, ranges); } diff --git a/src/frontend-common/imgui_styles.h b/src/frontend-common/imgui_styles.h index 85f399444..ab652db88 100644 --- a/src/frontend-common/imgui_styles.h +++ b/src/frontend-common/imgui_styles.h @@ -3,5 +3,5 @@ namespace ImGui { void StyleColorsDarker(ImGuiStyle* dst = nullptr); -void AddRobotoRegularFont(float size = 15.0f); -} +ImFont* AddRobotoRegularFont(float size = 15.0f); +} // namespace ImGui