fontawesome-markers
An export of the fontawesome glyphs into named SVG Paths in javascript.
All glyphs have the same names as font-awesome, except they are capitalised, and underscored, eg "exclamation-circle" becomes "EXCLAMATION_CIRCLE"
Usage
To use this library, you only need to include fontawesome-markers.min.js
, and reference it like the examples below.
If you're a masochist, you can try extracting other webfonts (or newer versions of Font Awesome) using the scripts in extractor/
Example - Font Awesome on Google Maps
You can use these paths, in products like Google Maps, for example:
map: map icon: path: fontawesomemarkersEXCLAMATION_CIRCLE scale: 05 strokeWeight: 02 strokeColor: 'black' strokeOpacity: 1 fillColor: '#f8ae5f' fillOpacity: 07 clickable: false position: lat lng;
Example - Font Awesome on Canvas
You can also draw them to canvas, using the new Path2D api, you may need to use a polyfill for unsupported browsers
var canvas = document0;var ctx = canvas;var path = fontawesomemarkersEXCLAMATION_CIRCLE;ctxstrokeStyle="#ff0000";ctxlineWidth=2;ctxfillStyle="#0000ff";ctx;ctx;ctx;
Example - Loading Font Awesome Markers via JSON/ XHR
Instead of including it as an inline script, you can also load it with JSON/XHR.
var fontawesome = markers: null;var xhr = ;xhr{ fontawesomemarkers = JSON;}xhr;xhr;
Update
- 16th October 2014 - Updated to fontawesome 4.2.0
- 7th August 2014 - Updated to fontawesome 4.1.0, see the Fontawesome Upgrade Guide for the list of changed names.
- 26th September 2013 - Changed font extraction process - Glyph size is a much more manageable 64px now, and rotation / flip corrected.