css font-stacks
DESCRIPTION
A presentation on CSS font stacks - covering how to choose fonts that have similar aspect ratio and include a good range of fall-back fonts.TRANSCRIPT
![Page 1: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/1.jpg)
CSSFONT STACKS
![Page 2: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/2.jpg)
What are fontstacks?
![Page 3: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/3.jpg)
Font stacks are about creating arelevant and comprehensive
list of fall-back fonts - based onaspect ratio, platforms, operating
systems etc.
![Page 4: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/4.jpg)
A bad example
![Page 5: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/5.jpg)
body{
font-family: Verdana, Arial,sans-serif;
}
What’s wrong here?
![Page 6: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/6.jpg)
Problem 1:There are a limited number of
fallback fonts.
![Page 7: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/7.jpg)
Problem 2:The fonts used may not be
available for all operating systems(eg. Windows, Mac, Linux).
![Page 8: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/8.jpg)
Problem 3:The fonts used have different
“aspect ratios”
![Page 9: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/9.jpg)
What isaspect ratio?
![Page 10: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/10.jpg)
Some fonts, especially thosespecifically designed for screen,may appear wider and/or taller
than other fonts.
ax axVerdana @200pt Helvetica @200pt
![Page 11: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/11.jpg)
This means that these fonts havea larger aspect ratio.
![Page 12: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/12.jpg)
If you use font’s with differentaspect ratio, some people maysee your pages with a much
smaller font size than others.
body{
font-family: Verdana, Arial,sans-serif;
}
Larger aspect ratio
Smaller aspect ratio
![Page 13: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/13.jpg)
Ideally, your font stacks shouldinclude a range of fonts that have
a similar aspect ratio.
![Page 14: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/14.jpg)
The basic fontstacks based on
aspect ratio
![Page 15: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/15.jpg)
Wide sans-serif stack
eg:
VerdanaGeneva
![Page 16: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/16.jpg)
Narrow sans-serif stack
eg:
TahomaArial
Hevetica
![Page 17: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/17.jpg)
Wide serif stack
eg:
GeorgiaUtopia
![Page 18: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/18.jpg)
Narrow serif stack
eg:Times
Times New Roman
![Page 19: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/19.jpg)
Monospace stack
eg:Courier
Courier New
![Page 20: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/20.jpg)
Some steps tocreating a good
font stack
![Page 21: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/21.jpg)
1. Pick the font you like
eg. Helvetica Neue
![Page 22: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/22.jpg)
2. Determine whichbasic font-stack it belongs in
eg. Narrow sans-serif
![Page 23: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/23.jpg)
3. Choose a preferred Linuxvariation and a highly available
variation
eg. DejaVu Sans - 90.76% availability on LinuxURW Gothic L - 97.14% availability on Linux
![Page 24: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/24.jpg)
4. Choose a preferred Macintoshvariation and highly available
variation
eg. Helvetica Neue - 95.11% availability on Mac,Helvetica - 100.00% availability on Mac
![Page 25: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/25.jpg)
5. Choose a preferred Windowsvariation and a highly available
variation
eg. Arial - 99.32% availability on Win,Microsoft Sans-serif - 99.71% availability on Win
![Page 26: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/26.jpg)
6. Include the generic font family
eg. sans-serif
![Page 27: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/27.jpg)
7. Make sure fonts withwhite-space in names arewrapped in single or double
quotes.
(eg. “Microsoft Sans-serif”)
![Page 28: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/28.jpg)
body{
font-family:"DejaVu Sans", "URW Gothic L","Helvetica Neue”, Helvetica,Arial, "Microsoft Sans Serif",sans-serif;
}
A better font stack?
![Page 29: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/29.jpg)
ResultsFont name
DejaVu Sans
URW Gothic L
Helvetica Neue
Helvetica
Arial
Microsoft Sans Serif
sans-serif
Windows
0.00%
0.00%
1.51%
7.08%
90.79%
0.62%
0.00%
Mac
0.00%
0.00%
95.11%
4.89%
0.00%
0.00%
0.00%
Linux
90.76%
8.98%
0.00%
0.07%
0.13%
0.00%
0.06%
![Page 30: CSS font-stacks](https://reader033.vdocument.in/reader033/viewer/2022050804/54c731084a79596b058b459a/html5/thumbnails/30.jpg)
A great font-stack builder
Font stackhttp://www.codestyle.org/servlets/FontStack