From 53bff541e292c5d6cae73881a37bf8f7e4a5fd0a Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 28 Mar 2021 16:04:42 -0700 Subject: Add FontAwesome icon set --- core/CMakeLists.txt | 1 + core/fonts/FontAwesome5-Solid.otf | Bin 0 -> 591768 bytes core/src/Entrypoint/main.cpp | 9 ++++++++- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 core/fonts/FontAwesome5-Solid.otf (limited to 'core') diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index a8386b2..37fccd3 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -102,6 +102,7 @@ function(add_executable_variant TARGET_NAME) ) target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src + ${CMAKE_SOURCE_DIR}/3rdparty/iconfontheaders ${CMAKE_SOURCE_DIR}/3rdparty/imgui ${CMAKE_SOURCE_DIR}/3rdparty/imnodes ) diff --git a/core/fonts/FontAwesome5-Solid.otf b/core/fonts/FontAwesome5-Solid.otf new file mode 100644 index 0000000..8fb28d5 Binary files /dev/null and b/core/fonts/FontAwesome5-Solid.otf differ diff --git a/core/src/Entrypoint/main.cpp b/core/src/Entrypoint/main.cpp index b82214d..a8c988a 100644 --- a/core/src/Entrypoint/main.cpp +++ b/core/src/Entrypoint/main.cpp @@ -7,8 +7,8 @@ #include "Entrypoint/Vulkan.hpp" #include - #include +#include #include #include #include @@ -124,11 +124,18 @@ int main(int argc, char* argv[]) { auto backend = CreateBackend(backendOption); auto& io = ImGui::GetIO(); + // Includes latin alphabet, although for some reason smaller than if rendered using 18 point NotoSans regular io.Fonts->AddFontFromFileTTF("fonts/NotoSansSC-Regular.otf", 18, nullptr, io.Fonts->GetGlyphRangesChineseSimplifiedCommon()); + ImWchar kIconRanges[] = { ICON_MIN_FA, ICON_MAX_FA }; + ImFontConfig config; + config.MergeMode = true; + io.Fonts->AddFontFromFileTTF("fonts/FontAwesome5-Solid.otf", 14, &config, kIconRanges); + auto window = backend->GetWindow(); while (!glfwWindowShouldClose(window)) { backend->BeginFrame(); + ImGui::ShowDemoWindow(); backend->EndFrame(); } -- cgit v1.2.3-70-g09d2