Icon fonts are a great way to include small images like social media icons into your website. There are many options to choose from but in this post I tested Glyphter because it was easy to use, required no sign-up and is free. Unlike other services that have large libraries of icons to choose from which warrant their fees and hosting services, to use Glyphter you will need to have your image files designed and ready to go. I created .svg icons using Adobe Illustrator and saved each file separately.
Advantages
- Icon fonts can be styled just like any standard font using the CSS properties colour, font-size, and pseudo selectors like :hover or :before.
- They act as inline styles with your text.
- You only have to load one font to access to many icons instead of having multiple image files.
Disadvantages
- Font’s are only created in 1 colour. The icons I was originally using were white with a black background but Glyphter automatically cut out the white.
- Glyphter only supports letters, if you are looking to generate a full custom font with symbols/numbers you will need to look at another service.
How to Use Glyphter
- From your Finder Menu, drag and drop each icon into a character space on the page.
- Give your font a name.
- Enter your email address.
- Download the font.
Generating a Web Font Kit
Once you have the .ttf file that Glyphter provides you will need to use a web font generator like the one on Font Squirrel. The generator takes the .ttf file and re-creates it as an .eot, .svg, and .woff format, all of which are needed to install all to ensure that thhe font is accessible across all browsers.
- Click Add fonts.
- Select the .ttf file you downloaded from Glyphter.
- Select the ‘Optimal Setting’.
- Agree to the terms.
- Click ‘Download Your Kit’.
Embedding the font:
Font Squirel generates the bulletproof @fontface code you will need and puts it in a separate stylesheet.css file.
- Place the folder font-squirel generated and put it in the root folder of your website and rename it fonts.
- Open up the stylesheet.css file and copy/paste the @fontface code from their file into your css file. Remove the stylesheet.css file from your folder as you won’t need it any more.
- In front of the font file names insert fonts/ to make sure it’s got the correct directory name to find the files.
- Call and style the font just as you would any other.