FontAwesome constants for openframeworks
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin/data
src
README.md
addon_config.mk
preview.png

README.md

ofxFontAwesome

Simple list of constants to use FontAwesome in OpenFrameworks. Includes FontAwesome version 4.

Install Instruction

  1. Clone this repo into your addons folder
  2. Drag ofxFontAwsome to your project
  3. Make sure fontawesome-webfont.ttf is copied during the build stage. a. OSX: Click on your target, go to Build-Phases, add this to the Run Script phase:
    cp -rf ../../../addons/ofxFontAwesome/bin/data/ "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources" b. Windows: ?? c. Linux: ?? d. Alternative: Just drop the ttf in your bin/data folder

Usage

Only works with ofxFontStash

#include "ofxFontAwesome.h"
#include "ofxFontStash.h"

ofxFontStash font = NULL;

void ofApp::setup(){
		font.loadFont("fontawesome-webfont.ttf", 100);
}

void ofApp::draw(){
	ofBackground(0); 
	
	ofSetColor(255);
	font.drawString( ofxFontAwesome::compress + "    " + ofxFontAwesome::expand, 50, 100);
}

Produces the following output:

Preview image

Licensing

The font itself (fontawesome-webfont.ttf) is licensed under the SIL OFL1.1, the "code" is under the WTFPL