Icon fonts and library not rendering at all. #9268
AhmedElghamriny
started this conversation in
New Users Build/Link/Run issues ONLY!
Replies: 1 comment 4 replies
-
|
(1) Which version of imgui are you using and which backend? Does the backend supports |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I’m currently integrating Font Awesome with Dear ImGui, but I’m running into an issue where the icons are displayed as question marks (?), and in the Metrics/Debugger window the only font shown is ProggyClean.ttf.
#define FONT_ICON_FILE_NAME_FAR "fonts/fa-regular-400.ttf"
#define FONT_ICON_FILE_NAME_FAS "fonts/fa-solid-900.ttf"
#define FONT_ICON_FILE_NAME_FWEB "fonts/fontawesome-webfont.ttf"
#define FONT_ICON_FILE_NAME_FKWEB "fonts/forkawesome-webfont.ttf"
I found an earlier thread describing a similar issue and followed the suggested steps. I also tried using a different .ttf file for Font Awesome, but I’m still getting the same result.
My font loading code:
ImGuiIO& io = ImGui::GetIO(); (void)io; io.Fonts->AddFontDefault(); // Font awesome setup static const ImWchar icons_ranges[] = { ICON_MIN_FA, ICON_MAX_FA, 0 }; ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true; ImFont* iconFont = io.Fonts->AddFontFromFileTTF(FONT_ICON_FILE_NAME_FAS, 16.0f, &icons_config, icons_ranges); if (iconFont == nullptr) { std::cerr << "ERROR: Failed to load Font Awesome" << std::endl; } else { std::cout << "SUCCESS: Font Awesome loaded!" << std::endl; } io.Fonts->Build(); auto initFlag = ImGui::SFML::Init(window); auto updateFontTextureFlag = ImGui::SFML::UpdateFontTexture();Beta Was this translation helpful? Give feedback.
All reactions