What you see while the custom font is being downloaded isn't defined in the above code. It's defined in your other font-family
instructions throughout your CSS code.
Add other fonts after 'OpenSansRegular' value, separated by commas. From right to left:
- on the right, the family of your font.
serif
, sans-serif
, monospace
or cursive
(yay Comic Sans!). Here, OpenSansSth
is ... sans-serif
.
Your browser has a default for these families, Arial, Verdana or some other font in Linux, whatever. It's the user choice when you don't choose for him. The default family is serif
and the default font in Windows is 'Times New Roman'. That's why you see Times New Roman as a FOUC in IE.
- then a websafe font that is as close as possible as your custom font. Here it'd be a sans-serif font like Verdana or Arial. Maybe sans-serif and Verdana will be the same thing but you're never sure (especially with Linux users), so add both
- In between your custom font and the websafe one, you can add fonts that could be installed in quite a few OSes but aren't websafe like the ones installed with MS Office, Adobe Reader, OS X, Adobe Creative Suite, etc You'll find them in 10 to 90% of your visitor computers, but not 100%. Not everybody install a Creative Suite (only web professionals and other designers) and MS Office (I use LibreOffice) and there are different fonts installed in XP, Vista and 7
- finally, the leftmost value will be the custom name you gave to your custom font.
OpenSansRegular
in your site
Ex:
nav { font-family: 'Custom_at-font-face','closest font to the font-face one but certainly rarely found on computers by default', 'less close, 'not close but same family', Verdana,sans-serif;
}
Compatibility tables with percentages (maybe a bit old) http://www.codestyle.org/css/font-family/
Don't use 10 values, 3 to maybe 6 will be enough ;) In 2012 @font-face may cause rendering problems depending on the browser and the OS (aliasing) but it's very well supported so you can shorten your font-families.