That's cool, but you might want to look at IcoMoon first. It's an entirely web-based alternative that's much more flexible, doesn't require as many steps, and should fit any icon-font-related need you have.
Icon fonts are a great way to add sharp, flexible icons to your website using @font-face. Chris Coyier thinks they're a good idea, and you should too.
Hieroglyph lets you turn a directory of SVG icons into an SVG font, all simple-like. To produce the remaining web filetypes (eot, ttf, woff) run the font file through Fontsquirrel's generator.
If ImageMagick is installed (optional), hieroglyph will also draw a character sheet PNG for you.
To install the current version from RubyGems:
gem install hieroglyph
To install the most recent version, from GitHub:
git clone git@github.com:averyvery/hieroglyph.git && \
cd hieroglyph && \
gem build hieroglyph.gemspec && \
gem install hieroglyph
To do a quick test run, just generate some example glyphs and create a MyFont font like so:
hieroglyph -e && hieroglyph
Create a directory full of SVG glyphs, and run:
hieroglyph -n FontName -g path/to/glyphs -o destination/path
Font creation arguments:
-n, --name NAME name of the font you want generated (defaults to MyFont)
-o, --output OUTPUT_FOLDER where to output the generated font (defaults to current folder)
-g, --glyphs GLYPH_FOLDER where to find glyphs to generate from (defaults to "glyphs")
Misc (using these arguments will not produce a font:
-e, --example creats set of example glyphs, including two "bad" SVGs for reference
-v, --version display Hieroglyph version
-h, --help display all commands
Because hieroglyph only generates SVGs, you'll need to convert the resulting file to other formats yourself. The Font Squirrel Generator is usually the best tool for this, but as of May 2012 it was having trouble uploading/reading SVGs. If you run into this problem, try converting your font to a TTF first with Free Font Converter.
Mapping your icons to private-use unicode characters is an extra measure to prevent screenreaders from seeing them. You can see an example of this by running hieroglyph -e
, it just involves naming your glyph with a unicode characted before the dash.
The basic range of valid names runs from &
To create a full font using FontSquirrel, you'll need to use Expert mode and subset your font with the unicode characters.
Read more: Dan Scotton's tweet, Wikipedia
If you want to help out, great! As an inexperienced dev, I'd appreciate any help I can get — but I would most appreciate it in the form of suggestions, education, and well-justified changes. If you have a specific bug or feature you'd like to pull request for, please let me know about it so we're on the same page.
bundle install
rake install
bundle exec rake
0.1.4
Output is less verbose, more colorful
0.1.3
Fix applied for older versions of ruby
0.1.2
Better logging, more characters supported
0.1.1
Officially a ruby gem, character sheet added
0.1
Just a .rb script for converting simple SVGs to a font