2.9 KiB
2.9 KiB
IconFontCppHeaders
https://github.com/juliettef/IconFontCppHeaders
C++11, C89 and None headers for icon fonts Font Awesome, Google Material Design icons and Kenney game icons.
A set of header files for using icon fonts in C, C++ and None, along with the python generator used to create the files.
Each header contains defines for one font, with each icon code point defined as ICON_*, along with the min and max code points for font loading purposes.
Fonts
Example Code
Using dear imgui as an example UI library:
#include "IconsFontAwesome.h"
ImGuiIO& io = ImGui::GetIO();
io.Fonts->AddFontDefault();
// merge in icons from Font Awesome
static const ImWchar icons_ranges[] = { ICON_MIN_FA, ICON_MAX_FA, 0 };
ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true;
io.Fonts->AddFontFromFileTTF( fontFile.c_str(), 16.0f, &icons_config, icons_ranges);
// in an imgui window somewhere...
ImGui::Text( ICON_FA_FILE " File" ); // use string literal concatenation, ouputs a file icon and File as a string.
Projects using the font icon header files
bgfx - Cross-platform rendering library
Avoyd - Game
The Edit Tool UI uses dear imgui with Font Awesome fonts.
Credits
Development - Juliette Foucaut - @juliettef
Requirements - Doug Binks - @dougbinks
None language format definition and refactoring - Leonard Ritter - @paniq