Skip to content

Helper and generator classes to ease the use of FontAwesome in c++.

Notifications You must be signed in to change notification settings

cdxfish/FontAwesomeCpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

FontAwesome helper for c++

Helper and generator to ease the use of FontAwesome in c++. The name of each icons are parsed from the css file and stay the same as in the original API:

#include "FontAwesome.h"

static std::vector<string> someIcons = {	
  	fa::glass(),
	fa::music(),
	fa::search(),
	fa::heart(),
	fa::star(),
	fa::user(),
	fa::film(),
	fa::check(),
	fa::remove(),
	fa::close(),
	fa::times(),
	fa::search_plus(),
	fa::search_minus(),
	fa::power_off(),
	fa::signal(),
	fa::gear(),
	fa::cog(),
	fa::trash_o(),
	fa::home(),
	fa::file_o(),
	fa::clock_o() 
};

void drawHeartIcon( const vec2 &position )
{
  string icon = fa::heart();
  drawString( icon, position );
}

You can also query the whole character set with fa::allChars() or its range with fa::charsRange() in case you need to generate some texture atlas...

If you want to re-generate the FontAwesome.h file, you can use the FontAwesomeGenerator and this line of code :

#include "FontAwesomeGenerator.h"

int main( int argc, char **argv )
{
  FontAwesomeGenerator::write( "pathTo/font-awesome.css", "otherPathTo/FontAwesome.h" );
}

About

Helper and generator classes to ease the use of FontAwesome in c++.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%