diff --git a/bindings/imgui_bundle/hello_imgui.pyi b/bindings/imgui_bundle/hello_imgui.pyi index 1762e075..a112b58e 100644 --- a/bindings/imgui_bundle/hello_imgui.pyi +++ b/bindings/imgui_bundle/hello_imgui.pyi @@ -277,14 +277,8 @@ def log_gui(size: ImVec2 = ImVec2(0.0, 0.0)) -> None: pass # //////////////////////////////////////////////////////////////////////////////////////////////////////////////// -# hello_imgui/icons_font_awesome.h included by hello_imgui.h // +# hello_imgui.h continued // # ////////////////////////////////////////////////////////////////////////////////////////////////////////////// -# Generated by https://github.com/juliettef/IconFontCppHeaders script -# GenerateIconFontCppHeaders.py for language C89 from -# https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/metadata/icons.yml -# for use with -# https://github.com/FortAwesome/Font-Awesome/blob/master/webfonts/fa-solid-900.ttf, -# https://github.com/FortAwesome/Font-Awesome/blob/master/webfonts/fa-regular-400.ttf, # //////////////////////////////////////////////////////////////////////////////////////////////////////////////// # hello_imgui/image_from_asset.h included by hello_imgui.h // @@ -591,6 +585,7 @@ class FontLoadingParams: # if True, the font will be loaded and then FontAwesome icons will be merged to it # (deprecated, use mergeToLastFont instead, and load in two steps) + # This will use an old version of FontAwesome (FontAwesome 4) # bool mergeFontAwesome = false; /* original C++ signature */ merge_font_awesome: bool = False # ImFontConfig fontConfigFontAwesome = ImFontConfig(); /* original C++ signature */ @@ -621,6 +616,36 @@ def load_font( ) -> ImFont: pass +# Note: if you want to use a more recent version of Font Awesome, +# =============================================================== +# see example at src/hello_imgui_demos/hello_imgui_demo_fontawesome6 +# +# The principle is summarized below: +# - Download Font_Awesome_6_Free-Solid-900.otf from https://fontawesome.com/download +# - Download IconsFontAwesome6.h from https://raw.githubusercontent.com/juliettef/IconFontCppHeaders/main/IconsFontAwesome6.h +# +# Code: +# +# // Prevent HelloImGui from loading Font Awesome 4 definitions, since we will load FontAwesome 6 +# #define HELLOIMGUI_NO_FONT_AWESOME4 +# #include "hello_imgui/hello_imgui.h" +# #include "IconsFontAwesome6.h" +# +# ... +# +# // Load the default font + merge it with Font Awesome 6 +# HelloImGui::RunnerParams runnerParams; +# runnerParams.callbacks.LoadAdditionalFonts = [] +# { +# // Load the default font +# HelloImGui::LoadFont("fonts/DroidSans.ttf", 15.0); +# +# // Merge FontAwesome6 with the default font +# HelloImGui::FontLoadingParams fontParams; +# fontParams.mergeToLastFont = True; +# fontParams.useFullGlyphRange = True; +# HelloImGui::LoadFont("fonts/Font_Awesome_6_Free-Solid-900.otf", 15.0, fontParams); +# }; # @@md # @@ -1145,7 +1170,8 @@ class ImGuiWindowParams: # ImVec4 backgroundColor = ImVec4(0.f, 0.f, 0.f, 0.f); /* original C++ signature */ # backgroundColor: - # This is the "clearColor", visible if defaultImGuiWindowType!=ProvideFullScreenWindow. + # This is the "clearColor", i.e. the app window background color, is visible *only if* + # runnerParams.imGuiWindowParams.defaultImGuiWindowType = NoDefaultWindow # Alternatively, you can set your own RunnerCallbacks.CustomBackground to have full # control over what is drawn behind the Gui. background_color: ImVec4 = ImVec4(0.0, 0.0, 0.0, 0.0) diff --git a/external/hello_imgui/bindings/hello_imgui_amalgamation.h b/external/hello_imgui/bindings/hello_imgui_amalgamation.h index a98795a9..63d92e41 100644 --- a/external/hello_imgui/bindings/hello_imgui_amalgamation.h +++ b/external/hello_imgui/bindings/hello_imgui_amalgamation.h @@ -220,6 +220,12 @@ namespace HelloImGui void LogGui(ImVec2 size=ImVec2(0.f, 0.f)); } +////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// hello_imgui.h continued // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef HELLOIMGUI_NO_FONT_AWESOME4 + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // hello_imgui/icons_font_awesome.h included by hello_imgui.h // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1192,6 +1198,12 @@ namespace HelloImGui #define ICON_FA_CHEVRON_UP "\xEF\x81\xB7" #define ICON_FA_HAND_SPOCK "\xEF\x89\x99" #define ICON_FA_HAND_POINT_UP "\xEF\x82\xA6" +////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// hello_imgui.h continued // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#endif + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // hello_imgui/image_from_asset.h included by hello_imgui.h // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1405,6 +1417,7 @@ namespace HelloImGui // if true, the font will be loaded and then FontAwesome icons will be merged to it // (deprecated, use mergeToLastFont instead, and load in two steps) + // This will use an old version of FontAwesome (FontAwesome 4) bool mergeFontAwesome = false; ImFontConfig fontConfigFontAwesome = ImFontConfig(); }; @@ -1419,6 +1432,36 @@ namespace HelloImGui const FontLoadingParams & params = {}); + // Note: if you want to use a more recent version of Font Awesome, + // =============================================================== + // see example at src/hello_imgui_demos/hello_imgui_demo_fontawesome6 + // + // The principle is summarized below: + // - Download Font_Awesome_6_Free-Solid-900.otf from https://fontawesome.com/download + // - Download IconsFontAwesome6.h from https://raw.githubusercontent.com/juliettef/IconFontCppHeaders/main/IconsFontAwesome6.h + // + // Code: + // + // // Prevent HelloImGui from loading Font Awesome 4 definitions, since we will load FontAwesome 6 + // #define HELLOIMGUI_NO_FONT_AWESOME4 + // #include "hello_imgui/hello_imgui.h" + // #include "IconsFontAwesome6.h" + // + // ... + // + // // Load the default font + merge it with Font Awesome 6 + // HelloImGui::RunnerParams runnerParams; + // runnerParams.callbacks.LoadAdditionalFonts = [] + // { + // // Load the default font + // HelloImGui::LoadFont("fonts/DroidSans.ttf", 15.0f); + // + // // Merge FontAwesome6 with the default font + // HelloImGui::FontLoadingParams fontParams; + // fontParams.mergeToLastFont = true; + // fontParams.useFullGlyphRange = true; + // HelloImGui::LoadFont("fonts/Font_Awesome_6_Free-Solid-900.otf", 15.0f, fontParams); + // }; // @@md @@ -1835,7 +1878,8 @@ struct ImGuiWindowParams ImGuiTheme::ImGuiTweakedTheme tweakedTheme; // backgroundColor: - // This is the "clearColor", visible if defaultImGuiWindowType!=ProvideFullScreenWindow. + // This is the "clearColor", i.e. the app window background color, is visible *only if* + // runnerParams.imGuiWindowParams.defaultImGuiWindowType = NoDefaultWindow // Alternatively, you can set your own RunnerCallbacks.CustomBackground to have full // control over what is drawn behind the Gui. ImVec4 backgroundColor = ImVec4(0.f, 0.f, 0.f, 0.f); diff --git a/external/hello_imgui/bindings/pybind_hello_imgui.cpp b/external/hello_imgui/bindings/pybind_hello_imgui.cpp index 683d2861..9855710e 100644 --- a/external/hello_imgui/bindings/pybind_hello_imgui.cpp +++ b/external/hello_imgui/bindings/pybind_hello_imgui.cpp @@ -551,7 +551,7 @@ void py_init_module_hello_imgui(py::module& m) .def_readwrite("full_screen_window_margin_top_left", &HelloImGui::ImGuiWindowParams::fullScreenWindow_MarginTopLeft, "") .def_readwrite("full_screen_window_margin_bottom_right", &HelloImGui::ImGuiWindowParams::fullScreenWindow_MarginBottomRight, "") .def_readwrite("tweaked_theme", &HelloImGui::ImGuiWindowParams::tweakedTheme, " tweakedTheme: (enum ImGuiTheme::ImGuiTweakedTheme)\n Changes the ImGui theme. Several themes are available, you can query the list\n by calling HelloImGui::AvailableThemes()") - .def_readwrite("background_color", &HelloImGui::ImGuiWindowParams::backgroundColor, " backgroundColor:\n This is the \"clearColor\", visible if defaultImGuiWindowType!=ProvideFullScreenWindow.\n Alternatively, you can set your own RunnerCallbacks.CustomBackground to have full\n control over what is drawn behind the Gui.") + .def_readwrite("background_color", &HelloImGui::ImGuiWindowParams::backgroundColor, " backgroundColor:\n This is the \"clearColor\", i.e. the app window background color, is visible *only if*\n runnerParams.imGuiWindowParams.defaultImGuiWindowType = NoDefaultWindow\n Alternatively, you can set your own RunnerCallbacks.CustomBackground to have full\n control over what is drawn behind the Gui.") ;