How to generate webkit fonts
-
In order to put a font on a webpage, I use a webkit font generator called
fontsquirrel
to turn TrueType fonts into the types that the web can understand:
TTF, WOFF, EOT, SVG.
This is a webkit font in action. Lorem ipsem eps.
Steps to generate a webkit font
- I create a TrueType font using TypeTool 3 (with a little help from my CINTIQ pen and Adobe Illustrator).
I like to make my own fonts from scratch. If you prefer to pick a font lovingly designed by a professional designer,
TypeKit is very easy to use.
- I submit this file to fontsquirrel's web font generator. It generates a zip file with TTF, WOFF, EOT, SVG, a CSS file, and a demo file. In this zip file is a snippet of code that looks like this:
@font-face {
font-family: 'MyWebFont';
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff') format('woff'), /* Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
- I copy the font files (the contents of the zip) to my web server.
- I copy the block of code above to my CSS file and modify it to point to where the
fonts reside on my web server.
- I may have to adjust file permissions to make sure everything works.
- I then can use the font by adding the "font-family" property anywhere in my stylesheet.
- You may also choose from the free fonts on fontsquirrel.com. Warning: don't use @font-face too many times, it will slow down your website!