1# IconFontCppHeaders
2
3[https://github.com/juliettef/IconFontCppHeaders](https://github.com/juliettef/IconFontCppHeaders)
4
5C++11, C89 and None headers for icon fonts Font Awesome, Google Material Design icons and Kenney game icons.
6
7A set of header files for using icon fonts in C, C++ and [None](https://bitbucket.org/duangle/nonelang/src), along with the python generator used to create the files.
8
9Each 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.
10
11## Fonts
12
13* [Font Awesome](http://fontawesome.io/)
14    * [github repository](https://github.com/FortAwesome/Font-Awesome/)
15    * [fontawesome-webfont.ttf](https://github.com/FortAwesome/Font-Awesome/blob/master/fonts/fontawesome-webfont.ttf)
16* [Google Material Design icons](https://design.google.com/icons/)
17    * [github repository](https://github.com/google/material-design-icons/)
18    * [MaterialIcons-Regular.ttf](https://github.com/google/material-design-icons/blob/master/iconfont/MaterialIcons-Regular.ttf)
19* [Kenney Game icons](http://kenney.nl/assets/game-icons) and [Game icons expansion](http://kenney.nl/assets/game-icons-expansion)
20    * [github repository](https://github.com/SamBrishes/kenney-icon-font)
21    * [kenney-icon-font.ttf](https://github.com/SamBrishes/kenney-icon-font/blob/master/fonts/kenney-icon-font.ttf)
22
23## Example Code
24
25Using [dear imgui](https://github.com/ocornut/imgui) as an example UI library:
26
27    #include "IconsFontAwesome.h"
28
29    ImGuiIO& io = ImGui::GetIO();
30     io.Fonts->AddFontDefault();
31
32     // merge in icons from Font Awesome
33    static const ImWchar icons_ranges[] = { ICON_MIN_FA, ICON_MAX_FA, 0 };
34    ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true;
35    io.Fonts->AddFontFromFileTTF( fontFile.c_str(), 16.0f, &icons_config, icons_ranges);
36
37    // in an imgui window somewhere...
38    ImGui::Text( ICON_FA_FILE "  File" ); // use string literal concatenation, ouputs a file icon and File as a string.
39
40## Projects using the font icon header files
41
42### [bgfx](https://github.com/bkaradzic/bgfx) - Cross-platform rendering library
43
44### [Avoyd](http://www.avoyd.com) - Game
45The Edit Tool UI uses [dear imgui](https://github.com/ocornut/imgui) with [Font Awesome](http://fontawesome.io/) fonts.
46
47![Avoyd Edit Tool with Font Awesome fonts](https://www.enkisoftware.com/images/2017-02-22_Avoyd_Editor_UI_ImGui_Font_Awesome.png)
48
49## Credits
50
51Development - [Juliette Foucaut](http://www.enkisoftware.com/about.html#juliette) - [@juliettef](https://github.com/juliettef)
52Requirements - [Doug Binks](http://www.enkisoftware.com/about.html#doug) - [@dougbinks](https://github.com/dougbinks)
53[None language](https://bitbucket.org/duangle/nonelang/src) [format definition and refactoring](https://gist.github.com/paniq/4a734e9d8e86a2373b5bc4ca719855ec) - [Leonard Ritter](http://www.leonard-ritter.com/) - [@paniq](https://github.com/paniq)
54