This card intends to review the fonts used in skins and find alternatives that users could choose. Arial and Times New Roman (created in the time of CRT screens) is significantly less readable in 2020 than modern fonts optimized for LCD screens and font anti-aliasing.
My personal experience with using a userstyle to change the font to Noto Serif is that whenever I switch back to the original font, my eyes are strained. In my view adding the option of using more legible fonts would be a major enhancement for the readers.
Historically sans-serif fonts were assumed to be more legible on screens - on lower dpi than in print. Screen resolution, however, has continuously increased since that practice has been established. With the advancement of font anti-aliasing (ClearType), serif fonts today are similarly or even more legible than sans-serif fonts on screen.
Imo serif fonts as a style are more apt for an encyclopedia, but many readers prefer sans fonts, thus this card also intends to explore the possibility of giving the choice for users between serif and sans-serif fonts.
Prerequisite task
The feasible way to introduce the choice of fonts is in a viewing preferences dropdown:
- T244748: Add client-side skin preferences drop-down
- T91201: [GOAL] Accessibility settings/preferences on desktop and mobile
How to test these fonts
- Install a userstyle (download: addon, userstyle), open DevTools, then untick the fonts one by one, starting at the bottom. The last one enabled will be the visible font, except for the platform-specific fonts that aren't available on your device.
- The Noto Serif font for body and Lora (serif) font for heading with the custom theme which also resets the font-size in Timeless from 95% - 15.2px (typical) to the default 100% - 16px. For reference: Vector font-size is 87.5% - 14px.
- The Lato (sans) font for body and Lora (serif) font for heading by downloading the patch in skins/Timeless: git review -d 570074
- The Roboto (sans) font for body and Noto Serif font for heading by downloading the patch in skins/Vector: git review -d 570639
Discussions, research
- Font stack documentation
- Wikimedia Design Style Guide -- Typography
- Universal Language Selector/WebFonts
- Projects/Improve mobile reading experience
Articles
- How Typography Determines Readability: Serif vs. Sans Serif, and How To Combine Fonts.
- Serif vs. Sans Serif Fonts: Is One Really Better Than the Other?
Current fonts used
Minerva skin:
@fontFamilySans: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Lato', 'Helvetica', 'Arial', sans-serif; @font-family-serif: 'Linux Libertine', 'Georgia', 'Times', serif; @font-family-monospace: 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace; h1, h2, blockquote { font-family: @font-family-serif; } @supports ( font: -apple-system-body ) { html { font: -apple-system-body; }
Timeless skin:
@fonts: 'Segoe UI', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Lato', 'Liberation Sans', 'Noto Sans', 'Helvetica Neue', 'Helvetica', sans-serif; @fonts-secondary: 'Linux Libertine', 'Times New Roman', 'Liberation Serif', 'Nimbus Roman', 'Noto Serif', 'Times', serif; @fonts-mono: 'Menlo', 'Consolas', 'Monaco', 'Noto Mono', 'Nimbus Mono L', monospace; body, .toctitle h2 { fonts } a, h1-h6, dt { secondary }
Vector skin:
@font-family-serif: 'Linux Libertine', 'Georgia', 'Times', serif; @font-family-sans: sans-serif; /* Arial on Windows */ body { sans } print, mw-body h1, -content h1, -content h2 { serif }
Modern, MonoBook: font-family: sans-serif;
CologneBlue:
font-family: 'Verdana', 'Arial', sans-serif; #sitetitle { font-family: 'Times', serif; }
Current font sizes
Pixel count is different on HiDPI.
CologneBlue (2003): 10pt -> 13+1/3px
MonoBook: 79.375% -> 12.7px
Modern (2008): 13px
Vector (2010): 87.5% -> 14px
Timeless (2015): 95% -> 15.2px
Minerva: 100% -> 16px
This reflects how devices were becoming higher resolution throughout the years.
The chosen fonts might depend on the font-size, <16px is a typical breakpoint.
I also envision a user setting to choose the font-size and one of: 1) sans-serif font for small font-size (<16px) 2) serif font 3) sans-serif font.
For default, I suggest following the industry practice of bigger fonts than before and changing the default font-size in the new Vector from 14px to the initial 100% (16px typical).
Proposed fonts
- Noto Serif for >= 16px
- Roboto Slab (serif) for < 16px
- Lato (sans) or Roboto (sans) for old skins, < 16px (MonoBook, Modern)
- Lora (serif) for the headings.
- Lato (sans) or Poppins (sans) or Verdana (sans) for the logo-text and header.
- Fira Code, Hack and Source Code Pro for monospaced typeface.
All fonts loaded from the wmf fontcdn except 'Hack'.
16px and above: Noto Serif
@font-family-monospace: 'Fira Code', 'Hack', 'Source Code Pro', 'Consolas', 'Menlo', 'Monaco', 'Noto Mono', 'Nimbus Mono L', 'Inconsolata', 'Ubuntu Mono', monospace; @font-family-sans: 'Lato', 'Noto Sans', 'Roboto', -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Segoe UI Historic', 'Liberation Sans', 'Helvetica', sans-serif; @font-family-serif: 'Noto Serif', 'Roboto Slab', 'Georgia', 'Linux Libertine', 'Liberation Serif', 'Nimbus Roman', 'Times', serif; @font-family-base: @font-family-serif; body { font-family: @font-family-base; }
Below 16px: Lato (from Wikimedia Design Style Guide), Roboto (new Android font) before Noto (former Android font)
@font-family-sans: 'Lato', 'Roboto', 'Noto Sans', -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Segoe UI Historic', 'Lato', 'Liberation Sans', 'Helvetica', sans-serif; @font-family-serif: 'Noto Serif', 'Georgia', 'Linux Libertine', 'Liberation Serif', 'Nimbus Roman', 'Times', serif; @font-family-base: @font-family-sans; body { font-family: @font-family-base; }
All sizes: Lora for headings, Lato / Poppins / Verdana for logo
@font-family-heading-sans: 'Lato', 'Poppins', 'Verdana', @font-family-sans; @font-family-heading-serif: 'Lora', @font-family-serif; @font-family-heading: @font-family-heading-serif; @font-family-logo: @font-family-heading-sans; h1-h6 { font-family: @font-family-heading; }
Reasoning
Noto is the previous default Android font. Just slightly different from Roboto, I've found it a bit more balanced and pleasant. Also widely used. The style guide suggests using it as it "provides great coverage of languages".
Personally I haven't tested these fonts with non-latin scripts, that needs to be done yet and I hope there will be some advice regarding how that's done in MediaWiki development.
Roboto is the default for Android since 4.0, widely spread, also used on web pages, very clear, legible and recognized as the font for Android.
For the headings, I've chosen Lora (serif) and Poppins (sans) from 10-20 randomly encountered fonts while searching for a candidate.
I use Lato, previously Poppins (bold) for the logo font in Timeless. Poppins is bulky and blocky, see the screenshots. A good, clean alternative is Verdana, which is available on Windows only.
For monospaced I prefer Fira Code, Hack, purposefully designed for source code or Source Code Pro (Adobe). Hack has a package for installing, Fira Code and Source Code Pro are already available on the fontcdn. The rest is from Timeless: Consolas is part of Windows since Vista, Menlo (Mac) looks even better than Consolas. Monaco idk, Ubuntu Mono... too small and the stroke width feels inconsistent to me, but readable at small sizes. Inconsolata is also a favored font that could be considered. I find it too thin.
Share your suggestions, too.