Through getting some answers here and some research, I\'ve come across a new approach to implementing icons. Rather than as images or css background, it seems you can approa
I've successfully created a few icon fonts for my websites and the Inkscape FontForge approach as outlined in this how-to is pretty solid, and if you're used to using software such as Inkscape, it's also pretty easy too. Here's the steps I take:
I'll often leave this plain SVG document open, pasting in new icons and centering and sizing according to the last. This way there is size and position consistency across the icon set (and you don't have to keep choosing the directory to save your plain SVGs).
Change the following:
In the main window, choose File > Generate Fonts and save to TrueType (ignoring any errors).
Hope that's of help.
Here's an open source example of what you're looking to do:
http://fortawesome.github.com/Font-Awesome/
If you look at their code, you can see how to run the CSS:
https://github.com/FortAwesome/Font-Awesome/blob/master/css/font-awesome.css
And if you want to edit the fonts, download FontAwesome.ttf and edit in FontForge. If you want to do your own TTF, you could, but just take a look and copy how they did it I guess.
(Disclaimer: I haven't done this part of the process. On our team one of the guys uses a proprietary Mac App to come up with the font. If I need to do my own icon fonts in future I'll probably use Inkscape and FontForge though. I've checked enough to see that FontForge can import SVG, I haven't tried it though).
When you're done and you have your TTF font as you want it, you need to convert the font into the many different formats needed to use as a web font. I use this free online tool:
http://fontface.codeandmore.com/
... which will give you your EOT, SVG, TTF and WOFF font files, which should cover you for almost all browsers. You then need to include these files in your CSS, as demonstrated in the file linked above. Note: for the SVG file, there is an ID that you will have to update. I think it is automatically chosen by the conversion tool, so you'll have to edit the SVG, check what the ID is and include it.
For example, in this code:
@font-face {
font-family: 'MyIcons';
src: url('myiconfont-iconglyphs.eot');
src: url('myiconfont-iconglyphs.eot#iefix') format('embedded-opentype'),
url('myiconfont-iconglyphs.woff') format('woff'),
url('myiconfont-iconglyphs.ttf') format('truetype'),
url('myiconfont-iconglyphs.svg#myiconfont-regular') format('svg');
font-weight: normal;
font-style: normal;
}
You may have to change the #myiconfont-regular
bit after the svg definition.