Icon Font not rendering correctly #5275
Replies: 3 comments 6 replies
-
Using |
Beta Was this translation helpful? Give feedback.
-
So, of course, the issue happened to be with the font itself. The IconFontCppHeaders example used fa-solid-900.ttf and ImGui example used fontawesome-webfont.ttf while I tried to use fa-regular-400.ttf. The confusion came from these lines in the IconFontCppHeaders example, that do not mention the reduced glyph set of the regular version and then explicitly use the io.Fonts->AddFontFromFileTTF( FONT_ICON_FILE_NAME_FAS, 16.0f, &icons_config, icons_ranges );
// use FONT_ICON_FILE_NAME_FAR if you want regular instead of solid
// in an imgui window somewhere...
ImGui::Text( ICON_FA_PAINT_BRUSH " Paint" ); // use string literal concatenation Switching to fontawesome-webfont.ttf or forkawesome-webfont.ttf fixed the issue: |
Beta Was this translation helpful? Give feedback.
-
You can update the copy of dear imgui in that repo.
|
Beta Was this translation helpful? Give feedback.
-
Version/Branch of Dear ImGui:
Version: Dear ImGui 1.88 WIP (18718)
Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_sdl.cpp + imgui_impl_opengl3.cpp
Compiler: MSVC | Clang 10.0.0
Operating System: Windows 10 | Ubuntu 20.04.4
My Issue/Question:
I'm using
IconsFontAwesome5.h
from IconFontCppHeaders and fa-regular-400.ttf.Screenshots/Video
Standalone, minimal, complete and verifiable example:
Beta Was this translation helpful? Give feedback.
All reactions