Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Jan 30, 2024
1 parent 1e288be commit ed91f72
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
31 changes: 31 additions & 0 deletions src/hello_imgui/doc_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ See [hello_imgui_font.h](https://github.com/pthom/hello_imgui/blob/master/src/he
// 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();
};
Expand All @@ -110,6 +111,36 @@ See [hello_imgui_font.h](https://github.com/pthom/hello_imgui/blob/master/src/he
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);
// };
```

----
Expand Down
3 changes: 2 additions & 1 deletion src/hello_imgui/doc_params.md
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,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);
Expand Down

0 comments on commit ed91f72

Please sign in to comment.