C and C++ headers and C# classes for icon fonts: Font Awesome, Fork Awesome, Material Design, Material Design icons, Kenney game icons and Ionicons
Switch branches/tags
Nothing to show
Clone or download
Latest commit fc4960f Oct 18, 2018
Permalink
Failed to load latest commit information.
.gitignore simplified Apr 14, 2016
GenerateIconFontCppHeaders.py Added Font Awesome 5 Pro header files Oct 4, 2018
IconsFontAwesome4.cs Added C# icons classes Jun 8, 2018
IconsFontAwesome4.h Added Font Awesome 5 (see README for details) - Renamed Font Awesome … Mar 12, 2018
IconsFontAwesome4_c.h Added Font Awesome 5 (see README for details) - Renamed Font Awesome … Mar 12, 2018
IconsFontAwesome5.cs Font Awesome 5.4.1 Oct 13, 2018
IconsFontAwesome5.h Font Awesome 5.4.1 Oct 13, 2018
IconsFontAwesome5Brands.cs Font Awesome 5.4.1 Oct 13, 2018
IconsFontAwesome5Brands.h Font Awesome 5.4.1 Oct 13, 2018
IconsFontAwesome5Brands_c.h Font Awesome 5.4.1 Oct 13, 2018
IconsFontAwesome5Pro.cs Font Awesome 5.4.1 Oct 13, 2018
IconsFontAwesome5Pro.h Font Awesome 5.4.1 Oct 13, 2018
IconsFontAwesome5ProBrands.cs Font Awesome 5.4.1 Oct 13, 2018
IconsFontAwesome5ProBrands.h Font Awesome 5.4.1 Oct 13, 2018
IconsFontAwesome5ProBrands_c.h Font Awesome 5.4.1 Oct 13, 2018
IconsFontAwesome5Pro_c.h Font Awesome 5.4.1 Oct 13, 2018
IconsFontAwesome5_c.h Font Awesome 5.4.1 Oct 13, 2018
IconsForkAwesome.cs Fork Awesome 1.1.5 Oct 18, 2018
IconsForkAwesome.h Fork Awesome 1.1.5 Oct 18, 2018
IconsForkAwesome_c.h Fork Awesome 1.1.5 Oct 18, 2018
IconsIonicons.cs IonIcons use archived v2 files as input Jun 8, 2018
IconsIonicons.h IonIcons use archived v2 files as input Jun 8, 2018
IconsIonicons_c.h IonIcons use archived v2 files as input Jun 8, 2018
IconsKenney.cs Added C# icons classes Jun 8, 2018
IconsKenney.h Added Font Awesome 5 (see README for details) - Renamed Font Awesome … Mar 12, 2018
IconsKenney_c.h Added Font Awesome 5 (see README for details) - Renamed Font Awesome … Mar 12, 2018
IconsMaterialDesign.cs Added C# icons classes Jun 8, 2018
IconsMaterialDesign.h Added Font Awesome 5 (see README for details) - Renamed Font Awesome … Mar 12, 2018
IconsMaterialDesignIcons.cs Material Design Icons 2.8.94 Sep 26, 2018
IconsMaterialDesignIcons.h Material Design Icons 2.8.94 Sep 26, 2018
IconsMaterialDesignIcons_c.h Material Design Icons 2.8.94 Sep 26, 2018
IconsMaterialDesign_c.h Added Font Awesome 5 (see README for details) - Renamed Font Awesome … Mar 12, 2018
README.md Added Font Awesome 5 Pro header files Oct 4, 2018
licence.txt Changed licence from MIT to zlib Apr 21, 2017

README.md

IconFontCppHeaders

https://github.com/juliettef/IconFontCppHeaders

C++11 and C89 headers and C# classes for icon fonts Font Awesome, Fork Awesome, Google Material Design icons, Material Design Icons, Kenney game icons and Ionicons.

A set of header files and classes for using icon fonts in C, C++ and C#, 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.

Icon Fonts

Font Awesome

Font Awesome 4

Font Awesome 5 - see notes below

Font Awesome 5 Pro - this is a paid product, see notes below

Files downloaded from fontawesome.com

  • ..\fontawesome-pro-n.n.n-web\metadata\icons.yml
  • ..\fontawesome-pro-n.n.n-web\webfonts\fa-brands-400.ttf
  • ..\fontawesome-pro-n.n.n-web\webfonts\fa-light-300.ttf
  • ..\fontawesome-pro-n.n.n-web\webfonts\fa-regular-400.ttf
  • ..\fontawesome-pro-n.n.n-web\webfonts\fa-solid-900.ttf

Fork Awesome

Google Material Design icons

Material Design icons

Kenney Game icons and Game icons expansion

Ionicons - version 2 archived

Notes about Font Awesome 5

Codepoints grouping

Font Awesome 5 splits the different styles of icons into different font files with identical codepoints for light, regular and solid styles, and a different set of codepoints for brands. We have put the brands into a separate header file.

Generating Pro header files

Download the Font Awesome Pro Web package. To generate the headers, drop icons.yml in the same directory as GenerateIconFontCppHeaders.py before running the script. The file icons.yml is under ..\fontawesome-pro-n.n.n-web\metadata\icons.yml where n.n.n is the version number.

Example Code

Using dear imgui as an example UI library:

    
    #include "IconsFontAwesome5.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( 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
    // outputs a paint brush icon and 'Paint' as a string.

Projects using the font icon header files

Avoyd

Avoyd is an abstract 6 degrees of freedom voxel game. The voxel editor's Edit Tool UI uses dear imgui with Font Awesome icon fonts.

bgfx

Cross-platform rendering library.

Credits

Development - Juliette Foucaut - @juliettef
Requirements - Doug Binks - @dougbinks
None language implementation and refactoring - Leonard Ritter - @paniq
Suggestion to add a define for the ttf file name - Sean Barrett - @nothings
Initial Font Awesome 5 implementation - Codecat - @codecat
Suggestion to add Fork Awesome - Julien Deswaef - @xuv
Suggestion to add Ionicons - Omar Cornut - @ocornut
C# language implementation - Rokas Kupstys - @rokups
Suggestion to add Material Design Icons - Gustav Madeso - @madeso