1개월 전 · Jul 18, 2026 7:57 AM
Embed FontAwesome TTF fonts directly in your compiled binary so you don't need external font files on disk:
- Convert
fa-solid-900.ttfto a C++ byte array usingbinary_to_compressed_c.exe. - Merge font glyphs with default font:
CPP
ImFontConfig config;
config.MergeMode = true;
config.PixelSnapH = true;
static const ImWchar icon_ranges[] = { ICON_MIN_FA, ICON_MAX_FA, 0 };
ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(font_compressed_data, font_compressed_size, 14.0f, &config, icon_ranges);Now you can use icons inline in text: ImGui::Button(ICON_FA_SHIELD_HALVED " Security");!