Typography, i.e. the use of fonts, on Wikipedia can often be a source of heated debates. This is because Wikipedia has never set an explicit font in its default skin. This was true for Monobook, and still holds for Vector. The base font for these skins are simply defined as font-family: sans-serif
. Likewise, the size of fonts also subject to debates. Vector uses the definition of font-size: 0.875em;
, which translates to 87.5% of the default fontsize set in a user's browser. Under Windows, the default fonts in browsers are normally defined as Arial at 16px for sans-serif, Times New Roman at 16px for serif and Courier New at 13px for monospace. 0.875 × 16 equals 14px exactly. However, all fonts shown here are 16px, the browser's default.
Below are some personal writings on web typography, and its potential use on Wikipedia. It focuses on fonts that are installed by default, as these provide a stable installed base. It also focuses heavily on Windows. Information relating to other platforms is very welcome.
How to use other fonts in an article
Here are the tags to use if you wish to change the font in the text of an article. Please note, fonts that have the same cap height, do not always match in x-height, making them hard to mix inline without scaling. Based on Arial as the base font, Comic Sans MS, Georgia, Trebuchet MS and Verdana are safe to use inline. Times New Roman is not safe to use inline without scaling. Although Courier New has a lower height, it remains legible, and is the de facto monospace font. (Arial Black and Impact are not listed, as these are header fonts.)
- Here are examples of code to use, for various fonts.
- Safe to use inline (see above for details):
- Arial; the base font,
- Comic Sans MS,
- Georgia,
- Trebuchet MS
- *Verdana
- Not safe to use inline (see above for details):
- Times New Roman
- Courier New
- below is how the font codes above would look when actually used.
- Safe to use inline (see above for details):
- Arial; the base font,
- Comic Sans MS,
- Georgia,
- Trebuchet MS
- Verdana are safe to use inline.
- Not safe to use inline (see above for details):
- Times New Roman
- Courier New
Legacy font names
Three fonts, named Helvetica, Times, and Courier were used by early web browsers. As new file formats for fonts developed, these public domain font-names were replaced with similar names that the designers could copyright, and are now effectively generic names for sans serif, serif, and mono‑spaced fonts, respectively.
Font | Sample | Variants |
---|---|---|
Helvetica | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Times | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Courier | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Available fonts
Core fonts for the Web
Font | Sample | Variants |
---|---|---|
Arial | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Times New Roman | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Courier New | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Comic Sans MS | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold |
Georgia | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Trebuchet MS | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Verdana | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Availablility
The Core fonts for the Web have an installed base of 99% on the Windows[1] (except Andalé Mono) and 92–98% on Mac OS X platforms,[2] as they are now part of the standard installation. Despite the necessity to install these fonts separately, they still enjoy an installed base of 65% among Linux installations.[3]
Originally part of the Core Web fonts, Andalé Mono is not installed with Windows (having been replaced by Lucida Console), resulting in only 4% of Windows installations having the font, as opposed to 92% on Mac OS X. It used to be shipped with Internet Explorer until version 6, and was only installed with Windows 98. As the fonts are still available online, it does have an installed base of 70% on Linux. As it is similar and metric-compatible to Lucida Console, it is recommended to always combine Lucida Console and Andalé Mono in a font stack.
Size
- Note: This section holds true for 13px, but since the Typography Refresh, most fonts no longer match in 14px.
Fonts that have the same cap height, do not always match in x-height, making them hard to mix inline without scaling. Based on Arial as the base font, Comic Sans MS, Georgia, Trebuchet MS and Verdana are safe to use inline. Times New Roman is not safe to use inline without scaling. Although Courier New has a lower height, it remains legible, and is the de facto monospace font. (Arial Black and Impact are not listed, as these are header fonts.)
Common Windows fonts
Font | Since | Sample | Variants |
---|---|---|---|
Tahoma | Windows 98 | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold |
Lucida Sans Unicode | Windows 98 | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular |
Lucida Console | Windows 98 | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular |
Microsoft Sans Serif | Windows 2000 | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular |
Palatino Linotype | Windows 2000 | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Franklin Gothic Medium | Windows XP | The Quick Brown Fox Jumps Over The Lazy Dog. | Medium, Medium Italic |
Segoe UI | Windows Vista | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Calibri | Windows Vista | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Cambria | Windows Vista | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Candara | Windows Vista | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Consolas | Windows Vista | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Constantia | Windows Vista | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Corbel | Windows Vista | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
All but Palatino Linotype and Segoe UI have one major drawback: they all come without bold and/or italic variants. The "new" Windows ClearType font family introduced in Windows Vista has consistent font metrics, but these do not match with the core web fonts listed above, so they need to be scaled when mixed.
Common Linux fonts
Font | Sample | Variants |
---|---|---|
Nimbus Sans L | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Nimbus Roman No9 L | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Nimbus Mono L | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Century Schoolbook L | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
URW Gothic L | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
URW Bookman L | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
URW Palladio L | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
DejaVu Sans | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
DejaVu Serif | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
DejaVu Sans Mono | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Liberation Sans | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Liberation Serif | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Liberation Mono | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
FreeSans | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
FreeSerif | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
FreeMono | The Quick Brown Fox Jumps Over The Lazy Dog. | Regular, Bold, Italic, Bold Italic |
Monospace fonts
When displaying code, a monospace font helps keep code readable and maintain formatting consistent, but there are caveats. Below are some common monospace fonts.
Courier New | The Quick Brown Fox Jumps Over The Lazy Dog. The Quick Brown Fox Jumps Over The Lazy Dog. |
Consolas | The Quick Brown Fox Jumps Over The Lazy Dog. The Quick Brown Fox Jumps Over The Lazy Dog. |
Lucida Console | The Quick Brown Fox Jumps Over The Lazy Dog. The Quick Brown Fox Jumps Over The Lazy Dog. |
Not all monospace fonts come with a bold weight variant, causing bold text to mis-align with the rest of the text. Andalé Mono and Lucida Console suffer badly from this. That leaves Courier New and Consolas as the only safe choices when bold and italic highlighting is used. It is best to let the browser decide which monospace font to use.
The monospace "bug"
When viewing monospace text here on Wikipedia, an often heard complaint is that it is shown too small (except in IE, where you cannot set any font sizes; it appears to use 13px regardless of the web page's base font size). This is actually not a bug, but a result of the combination of a website's default font size and the browser's default font size for monospace. By default, a (Windows) browser has its default font sizes set at 16px for serif and sans-serif, and 13px for monospace.
Vector has a base font size of 0.875em, and most browsers—except Firefox—correctly scale down all fonts, including the monospace font, accordingly. So monospace is shown at 0.875 x 13px = 11px (which is perceived as "too small"). Compensating the font-size will render the font too big in Firefox. The solution is to assign any font besides just "monospace", for example font-family: monospace, monospace;
or font-family: monospace, Courier;
. The browsers will ignore the second value. But it will no longer use the configured "monospace" font size and instead use the same size as sans-serif.
See also
- Wikipedia:Rendering math
References
- ^ "Windows font survey results". Code Style. Archived from the original on 2013-04-25. CS1 maint: discouraged parameter (link)
- ^ "Mac font survey results". Code Style. Archived from the original on 2012-02-10. CS1 maint: discouraged parameter (link)
- ^ "Linux font survey results". Code Style. Archived from the original on 2012-03-15. CS1 maint: discouraged parameter (link)
External links
- Aspect values, x-widths for fonts – for use with
font-size-adjust
, a CSS3 property for scaling fonts. - Compute the ‘normal line-height’ and the ‘aspect value’ of the installed fonts