Wikipedia:MONO

Wikipedia:Typography

Wikipedia:Typography


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 are 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):
    • <span style="font-family: Arial;">Arial</span>; the base font,
    • <span style="font-family: 'Comic Sans MS';">Comic Sans MS</span>,
    • <span style="font-family: Georgia;">Georgia</span>,
    • <span style="font-family: 'Trebuchet MS';">Trebuchet MS</span>
    • <span style="font-family: Verdana;">Verdana</span>
  • Not safe to use inline (see above for details):
    • <span style="font-family: 'Times New Roman';">Times New Roman</span>
    • <span style="font-family: 'Courier New';">Courier New</span>

  • 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
  • Not safe to use inline (see above for details):
    • Times New Roman
    • Courier New

Legacy font names

On Macs, Helvetica, Times, and Courier are three core fonts used by Adobe's PostScript and PDF technologies. All three fonts have been included on every Mac going back to the 1980s, and they are the default "sans-serif", "serif", and "monospace" fonts in almost all web browsers.

On early versions of Windows, these names referred to pixelated versions of the core PostScript fonts. As technology improved, rather than adopting the Mac fonts, Microsoft substituted Helvetica with Arial, Times with Times New Roman, and Courier with Courier New. All six of the aforementioned fonts have been included on Macs since the 2000s.

More information Font, Sample ...

Available fonts

Core fonts for the Web

More information Font, Sample ...

Availability

The Core fonts for the Web have an installed base of 99% on 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.

iOS has all the fonts listed in the table above, except Andalé Mono and Comic Sans MS. However, it does have a Comic Sans–like font called Chalkboard SE. Consider using this CSS font stack: font-family: "Comic Sans MS", Chalkboard SE, cursive, sans-serif;

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.)

Header fonts

Arial Black and Impact are part of the set of core fonts for the web, but they are very heavy designs that are only recommended for use at large sizes. In addition, Arial Black is not installed on iOS devices. Furthermore, Impact is not installed on ChromeOS devices or older iOS devices.

More information Font, Sample ...

Common Windows fonts

More information Font, Since ...

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.

On Mac, Tahoma and Microsoft Sans Serif have been part of the standard installation of macOS since 2007 (Mac OS X Leopard). Macs do not have Palatino Linotype, but they do have the PostScript version of Palatino, which looks the same but has slightly different metrics (i.e. height and width of characters). You can ensure Mac and Windows users get a similar experience by using this CSS font stack: font-family: Palatino, "Palatino Linotype", serif;

The other fonts in this list (e.g. Cambria, Calibri), come with Microsoft Word for Mac, but are not installed system-wide on newer (post-2011) versions. Regardless, since not all Macs have Word, you can't count on those fonts being installed. Segoe UI is not available on Mac through legitimate means. None of these fonts are available on iOS.

Common Linux fonts

More information Font, Sample ...

Monospaced fonts

When displaying code, a monospaced font helps keep code readable and maintain formatting consistent, but there are caveats. Below are some common monospaced fonts.

More information Font, Sample ...

Not all monospaced fonts come with a bold weight variant, causing bold text to misalign with the rest of the text. Andalé Mono and Lucida Console suffer badly from this. That leaves Courier, Courier New, Menlo and Consolas as the only safe choices when bold and italic highlighting is used. Courier New is the safest choice as it is the only monospaced font that is guaranteed to look the same on both Windows and Mac. However, Courier and Courier New are serif fonts, and sans-serif monospaced fonts are typically used for coding. That leaves Menlo and Consolas as the only sans-serif coding fonts. However, since Menlo and Consolas aren't included in both Windows and macOS at the same time, consider using Menlo and Consolas in a font stack.

Starting in 2020, Firefox for Mac has started using Menlo (instead of Courier) as the default "monospace" font.

The monospace "bug"

When viewing monospaced text here on Wikipedia, sometimes it is shown too small. This is 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 monospaced font, accordingly. So monospace is shown at 0.875 × 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.

Emoji fonts

When describing emojis, it helps to use a font that actually includes the glyph for that emoji. Most recent operating system versions include an emoji font, below are some common ones.

More information Font, Sample ...
  1. Noto Color Emoji is preinstalled on some Linux distributions like Ubuntu, Debian, Fedora, and postmarketOS, but not on others like Arch.

Mozilla Firefox and Thunderbird also package Twemoji Mozilla, derived from Twemoji, and use it as a fallback if a system-wide emoji font isn't available.[6][7]

  • Here are example emojis without specifying an emoji font:
    • 😀♥✏⚠⤴⤵
  • Here are example emojis with an emoji font stack:
    • 😀♥✏⚠⤴⤵

See also


References

  1. "Windows font survey results". Code Style. Archived from the original on 2013-04-25.
  2. "Mac font survey results". Code Style. Archived from the original on 2012-02-10.
  3. "Linux font survey results". Code Style. Archived from the original on 2012-03-15.
  4. "Segoe UI Emoji font family". 6 December 2021. Retrieved 6 September 2023.
  5. "System Fonts - Fonts - Apple Developer". 6 September 2023. Retrieved 6 September 2023.

Share this article:

This article uses material from the Wikipedia article Wikipedia:MONO, and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.