looper/backends/ui/imgui/IconFontCppHeaders
2024-03-23 18:41:26 -07:00
..
.gitignore UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
font.go UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
GenerateIconFontCppHeaders.py UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
go.mod UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsCodicons.cs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsCodicons.go UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsCodicons.h UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsCodicons.py UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsCodicons.rs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontaudio.cs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontaudio.go UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontaudio.h UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontaudio.py UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontaudio.rs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome4.cs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome4.go UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome4.h UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome4.py UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome4.rs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5.cs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5.go UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5.h UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5.py UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5.rs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5Brands.cs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5Brands.go UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5Brands.h UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5Brands.py UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5Brands.rs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5Pro.cs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5Pro.go UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5Pro.h UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5Pro.py UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5Pro.rs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5ProBrands.cs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5ProBrands.go UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5ProBrands.h UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5ProBrands.py UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome5ProBrands.rs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome6.cs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome6.go UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome6.h UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome6.py UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome6.rs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome6Brands.cs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome6Brands.go UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome6Brands.h UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome6Brands.py UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsFontAwesome6Brands.rs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsForkAwesome.cs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsForkAwesome.go UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsForkAwesome.h UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsForkAwesome.py UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsForkAwesome.rs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsKenney.cs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsKenney.go UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsKenney.h UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsKenney.py UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsKenney.rs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsMaterialDesign.cs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsMaterialDesign.go UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsMaterialDesign.h UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsMaterialDesign.py UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
IconsMaterialDesign.rs UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
licence.txt UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00
README.md UI backends, DBus interface, port to CMake build system 2024-03-23 18:41:26 -07:00

Support development of IconFontCppHeaders through GitHub Sponsors or Patreon

Become a Patron

IconFontCppHeaders

https://github.com/juliettef/IconFontCppHeaders

C and C++ headers, C# and Python classes, Rust files and Go package for icon fonts Font Awesome, Fork Awesome, Google Material Design icons, Kenney game icons, Fontaudio and Codicons.

A set of header files and classes for using icon fonts in C, C++, C#, Python, Rust and Go, 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, max and max 16 bit code points for font loading purposes. The min excludes the ASCII characters code points. The max 16 bit is for use with libraries that only support 16 bit code points, for example Dear ImGui.

In addition the python script can be used to convert ttf font files to C and C++ headers. Each ttf icon font file is converted to a C and C++ header file containing a single array of bytes. To enable conversion, run the GenerateIconFontCppHeaders.py script with 'ttf2headerC = True'.

Icon Fonts

Font Awesome

Font Awesome 4

Font Awesome 5 free

Font Awesome 5 pro

Font Awesome 6 free

Font Awesome 6 pro

Fork Awesome

Google Material Design icons

Kenney Game icons and expansion

Fontaudio

Codicons

Ionicons and webfont Material Design Icons

  • Unsupported as of 29 Apr 2020. See Issue #16.

Notes about Font Awesome 5 and 6

Codepoints grouping

Font Awesome 5 and 6 split 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 (Font Awesome 5)

Download the Font Awesome Pro Web package from fontawesome.com. 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.

Icon files:

  • ..\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

Example Code

Using Dear ImGui as an example UI library:


#include "IconsFontAwesome5.h"

ImGuiIO& io = ImGui::GetIO();
io.Fonts->AddFontDefault();
float baseFontSize = 13.0f; // 13.0f is the size of the default font. Change to the font size you use.
float iconFontSize = baseFontSize * 2.0f / 3.0f; // FontAwesome fonts need to have their sizes reduced by 2.0f/3.0f in order to align correctly

// merge in icons from Font Awesome
static const ImWchar icons_ranges[] = { ICON_MIN_FA, ICON_MAX_16_FA, 0 };
ImFontConfig icons_config; 
icons_config.MergeMode = true; 
icons_config.PixelSnapH = true; 
icons_config.GlyphMinAdvanceX = iconFontSize;
io.Fonts->AddFontFromFileTTF( FONT_ICON_FILE_NAME_FAS, iconFontSize, &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

Voxel editor and 6 degree of freedom FPS game with editable environments. The voxel editor's UI uses Dear ImGui with Font Awesome icon fonts.
www.avoyd.com

Screenshot of the the game Avoyd's Voxel Editor UI using an IconFontCppHeaders header file for Font Awesome with Dear ImGui

bgfx

Cross-platform rendering library
bkaradzic.github.io/bgfx/overview
github.com/bkaradzic/bgfx

glChAoS.P

Real time 3D strange attractors scout
www.michelemorrone.eu/glchaosp
github.com/BrutPitt/glChAoS.P

Screenshot of glChAoS.P UI using IconFontCppHeaders header file for Font Awesome with Dear ImGui

iPlug2

Cross platform C++ audio plug-in framework
iplug2.github.io
github.com/iplug2/iplug2

Lumix Engine

3D C++ open source game engine
github.com/nem0/LumixEngine

Screenshot of Lumix Engine editor using IconFontCppHeaders header file for Font Awesome with Dear ImGui

Tracy Profiler

Real time, nanosecond resolution, remote telemetry frame profiler for games and other applications.
bitbucket.org/wolfpld/tracy

New features in Tracy Profiler v0.6

Visual 6502 Remix

Transistor level 6502 Hardware Simulation
floooh.github.io/visual6502remix
github.com/floooh/v6502r

ImGuiFontStudio

Create font subsets
github.com/aiekick/ImGuiFontStudio

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
Fontaudio implementation - Oli Larkin - @olilarkin
Initial ttf to C and C++ headers conversion implementation - Charles Mailly - @Caerind
Python language implementation - Hang Yu - @yhyu13
Go language implementation - Matt Pharr - @mpp
Codicons implementation - Robert Ryan - @rtryan98
Rust language implementation - Gaeel Bradshaw-Rodriguez - @Bradshaw