Font-family and compatibility between Linux, Windows, MacOS X
Introduction
It's quite hard to choose a font-family that will work similarly and nicely on all OS.
Some useful links on the subject:
Tests
The table below tells what font you get on various OS for a given font-family:
font-family |
Mandriva Linux 2009.1 - 2010.1 |
Ubuntu 8.04 |
Ubuntu 8.04 with msttcorefonts |
MacOS X |
Windows |
font-family: sans-serif |
DejaVu Sans
[#1] |
DejaVu Sans
[#1] |
DejaVu Sans
[#1] |
Helvetica |
Arial |
font-family: Verdana |
N/A |
N/A |
Verdana
[#2] |
Verdana |
Verdana |
font-family: Arial |
Liberation Sans
[#3] |
N/A |
Arial
[#2] |
Arial |
Arial |
font-family: Helvetica |
Liberation Sans
[#4] |
Nimbus Sans L
[#5] |
Nimbus Sans L
[#5] |
Helvetica |
Arial (?) |
font-family: Helvetica Neue |
N/A |
N/A |
N/A |
Helvetica Neue |
N/A |
font-family: Geneva |
N/A |
N/A |
N/A |
Geneva |
N/A |
font-family: DejaVu Sans |
DejaVu Sans |
DejaVu Sans |
DejaVu Sans |
N/A |
N/A |
font-family: Bitstream Vera Sans |
Bitstream Vera Sans |
Bitstream Vera Sans |
Bitstream Vera Sans |
N/A |
N/A |
(A monospace font has been added to the font-family to show the fonts not available)
Explanations
- Helvetica, Arial and Liberation are mostly the same,
- Helvetica/Arial and DejaVu are quite different (DejaVu being much larger),
- DejaVu and "Bitstream Vera" are mostly the same,
- "font-family: sans-serif" gives the wider DejaVu on Linux,
- "font-family: Helvetica" gives similar results (on Ubuntu, it's somewhat different),
- "font-family: Arial" gives very similar results, but is not available on Ubuntu without ttf-liberation nor msttcorefonts,
Conclusion
If you want your web site to look very similar to Arial on the various OS, use:
font-family: Arial,Helvetica,sans-serif
Notes
- #1
-
Ubuntu and Mandriva have a specific fontconfig configuration (cf 1 and 2)
(It seems Ubuntu's configuration comes from Debian, but Debian doesn't have it anymore).
Fontconfig's default configuration is to prefer Bitstream Vera since commit "Prefer Bitstream Vera to DejaVu families" in 2006.
- #2
-
The package "msttcorefonts" installs Microsoft "Core fonts for the Web".
- #3
-
"Liberation Sans" is very similar to Arial.
- #4
-
Mandriva specific fontconfig configuration.
- #5
-
This is fontconfig default configuration.
Hint: to know which font is used under Linux, use fc-match
(eg: "fc-match Verdana").