Type on the web has evolved significantly over time as designers and developers have fought to overcome limitations on web fonts. This presentation provides a brief history of different techniques that have been used over the years to get around these obstacles, including image replacement and sIFR, before getting in-depth with @font-face.
Presented to Webuquerque on May 4, 2011.
6. EARLY HTML TYPE CONTROLS
<h1> – <h6>
<b> <i>
<strong> <em>
<pre> <code> <cite>
7. THE <font> TAG
• introduced in HTML 3.2 (January 1997)
• deprecated in HTML 4.0 (December 1997)
Yes, this has been deprecated for over 13 years.
stop using it.
13. IMAGE REPLACEMENT
BAD
<img> element with no alt attribute
BETTER
<img> element within <h1> (or similar)
BEST
CSS background-image replacement
14. IMAGE REPLACEMENT
IN YOUR HTML:
<h1 id=“title”>This is the headline</h1>
IN YOUR CSS:
h1#title {
height: 40px;
width: 350px;
overflow: hidden;
text-indent: -9999px;
background-image:url(headline.png);
}
15. IMAGE REPLACEMENT
PROS CONS
• design flexibility • filesize issues
• simple • easy to do badly
• “it just works” • maintenance
28. FONT FORMATS
Different browsers support different font file types:
TrueType OpenType WOFF
(mobile)Safari Safari IE9
Opera Opera Firefox 3.6
Firefox Firefox Chrome 6
EOT SVG
IE iOS<4.2
and of course you want to avoid local fonts...
31. THIRD-PARTY TOOLS
• take the complexities out
• often cost money
• providers:
Typekit.com
Fonts.com
Google.com/webfonts
Fontdeck.com
32. SELF-HOSTING
• no ongoing costs
• no CDN (for better or worse)
• require you to provide fonts in correct formats
• need to worry about licensing
This is fontsquirrel.
fontsquirrel is your friend!
37. ON THE HORIZON...
font-kerning
font-variant-ligatures
font-variant-caps
font-variant-numeric
font-variant-alternates
and more!
but still nothing for cross-platform rendering!