-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,475 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/hello_imgui_demos/hello_imgui_demo_fontawesome6/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include(hello_imgui_add_app) | ||
hello_imgui_add_app(hello_imgui_demo_fontawesome6 hello_imgui_demo_fontawesome6.cpp) |
1,401 changes: 1,401 additions & 0 deletions
1,401
src/hello_imgui_demos/hello_imgui_demo_fontawesome6/IconsFontAwesome6.h
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+186 KB
src/hello_imgui_demos/hello_imgui_demo_fontawesome6/assets/fonts/DroidSans.ttf
Binary file not shown.
Binary file added
BIN
+1000 KB
..._imgui_demos/hello_imgui_demo_fontawesome6/assets/fonts/Font_Awesome_6_Free-Solid-900.otf
Binary file not shown.
38 changes: 38 additions & 0 deletions
38
src/hello_imgui_demos/hello_imgui_demo_fontawesome6/hello_imgui_demo_fontawesome6.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Prevent HelloImGui from loading Font Awesome, since we will load FontAwesome | ||
#define HELLOIMGUI_NO_FONT_AWESOME4 | ||
#include "hello_imgui/hello_imgui.h" | ||
|
||
// Found at https://raw.githubusercontent.com/juliettef/IconFontCppHeaders/main/IconsFontAwesome6.h | ||
#include "IconsFontAwesome6.h" | ||
|
||
#include "imgui.h" | ||
|
||
|
||
int main() | ||
{ | ||
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); | ||
}; | ||
|
||
auto gui = []() { | ||
|
||
ImGui::Text("Hello, world!" ); | ||
ImGui::Text(ICON_FA_FACE_SMILE); | ||
ImGui::Text(ICON_FA_LAYER_GROUP); | ||
ImGui::Text(ICON_FA_ADDRESS_CARD); | ||
}; | ||
|
||
runnerParams.callbacks.ShowGui = gui; | ||
|
||
HelloImGui::Run(runnerParams); | ||
} |