Web typography

From HandWiki
Short description: Publishing considerations for the Web
Web fonts allow Web designers to use fonts that are not installed on the viewer's computer.

Web typography, like typography generally, is the design of pages – their layout and typeface choices. Unlike traditional print-based typography (where the page is fixed once typeset), pages intended for display on the World Wide Web have additional technical challenges and – given its ability to change the presentation dynamically – additional opportunities. Early web page designs were very simple due to technology limitations; modern designs use Cascading Style Sheets (CSS), JavaScript and other techniques to deliver the typographer's and the client's vision.

When HTML was first created, typefaces and styles were controlled exclusively by the settings of each web browser. There was no mechanism for individual Web pages to control font display until Netscape introduced the font element in 1995, which was then standardized in the HTML 3.2 specification. However, the computer font specified by the font element had to be installed on the user's computer or a fallback font, such as a browser's default sans-serif or monospace font, would be used. The first CSS specification was published in 1996 and provided the same capabilities.

The CSS2 specification was released in 1998 and attempted to improve the font selection process by adding font matching, synthesis and download. These techniques did not gain much use, and were removed in the CSS2.1 specification. However, Internet Explorer added support for the font downloading feature in version 4.0, released in 1997.[1] Font downloading was later included in the CSS3 fonts module, and has since been implemented in Safari 3.1, Opera 10 and Mozilla Firefox 3.5. This has subsequently increased interest in Web typography, as well as the use of font downloading.

CSS1

In the first CSS specification,[2] authors specified font characteristics via a series of properties:

  • font-family
  • font-style
  • font-variant
  • font-weight
  • font-size

All fonts were identified solely by name. Beyond the properties mentioned above, designers had no way to style fonts, and no mechanism existed to select fonts not present on the client system.

Web-safe fonts

Web-safe fonts are computer fonts that may reasonably be expected to be present on a wide range of computer systems, and used by Web content authors to increase the likelihood that content displays in their chosen font. If a visitor to a Web site does not have the specified font, their browser tries to select a similar alternative, based on the author-specified fallback fonts and generic families or it uses font substitution defined in the visitor's operating system.

Microsoft's Core fonts for the Web

Since being released under Microsoft's Core fonts for the Web program, Arial, Georgia, and Verdana have become three de facto fonts of the Web.
Main page: Core fonts for the Web

To ensure that all Web users had a basic set of fonts, Microsoft started the Core fonts for the Web initiative in 1996 (terminated in 2002). Released fonts include Arial, Courier New, Times New Roman, Comic Sans, Impact, Georgia, Trebuchet, Webdings and Verdana—under an EULA that made them freely distributable but also limited some rights to their use. Their high penetration rate has made them a staple for Web designers. However, most Linux distributions don't include these fonts by default.

CSS2 attempted to increase the tools available to Web developers by adding font synthesis, improved font matching and the ability to download remote fonts.[3]

Some CSS2 font properties were removed from CSS2.1 and later included in CSS3.[4][5]

Fallback fonts

The CSS specification allows for multiple fonts to be listed as fallback fonts.[6] In CSS, the font-family property accepts a list of comma-separated font faces to use, like so:

font-family: "Nimbus Sans L", Helvetica, Arial, sans-serif;

The first font specified is the preferred font. If this font is not available, the Web browser attempts to use the next font in the list. If none of the fonts specified are found, the browser displays its default font. This same process also happens on a per-character basis if the browser tries to display a character not present in the specified font.

Generic font families

To give Web designers some control over the appearance of fonts on their Web pages, even when the specified fonts are not available, the CSS specification allows the use of several generic font families. These families are designed to split fonts into several categories based on their general appearance. They are commonly specified as the last in a series of fallback fonts, as a last resort in the event that none of the fonts specified by the author are available. For several years, there were five generic families:[6]

Sans-serif

Fonts that do not have decorative markings, or serifs, on their letters. These fonts are often considered easier to read on screens.[7]

Serif

Fonts that have decorative markings, or serifs, present on their characters. These fonts are traditionally used in printed books.

Monospace

Fonts in which all characters are equally wide.

Cursive

Fonts that resemble cursive writing. These fonts may have a decorative appearance, but they can be difficult to read at small sizes, so they are generally used sparingly.

Fantasy

Fonts that may contain symbols or other decorative properties, but still represent the specified character.

CSS fonts working draft 4 with lesser browser support

[8] System-ui

Default fonts on a given system: the purpose of this option is to allow web content to integrate with the look and feel of the native OS.

ui-serif

Default fonts on a given system in a serif style

ui-sans-serif

Default fonts on a given system in a sans-serif style

ui-monospace

Default fonts on a given system in a monospace style

ui-rounded

Default fonts on a given system in a rounded style

Emoji

Fonts using emoji

Math

Fonts for complex mathematical formula and expressions.

Fangsong (Chinese: 仿宋体)

Chinese typefaces that are between serif Song and cursive Kai forms. This style is often used for government documents.

Web fonts

History

A technique to refer to and automatically download remote fonts was first specified in the CSS2 specification, which introduced the @font-face construct. At the time, fetching font files from the web was controversial because fonts meant to be used only for certain web pages could also be downloaded and installed in breach of the font license.[9]

Microsoft first added support for downloadable EOT fonts in Internet Explorer 4 in 1997. Authors had to use the proprietary WEFT tool to create a subsetted font file for each page. EOT showed that webfonts could work and the format saw some use in writing systems not supported by common operating systems. However, the format never gained widespread acceptance and was ultimately rejected by W3C.[10]

In 2006, Håkon Wium Lie started a campaign against using EOT and rather have web browsers support commonly used font formats.[11][12][13] Support for the commonly used TrueType and OpenType font formats has since been implemented in Safari 3.1, Opera 10, Mozilla Firefox 3.5 and Internet Explorer 9.

In 2010, the WOFF compression method for TrueType and OpenType fonts was submitted to W3C by the Mozilla Foundation, Opera Software and Microsoft, and browsers have since added support.[14][15][16]

Google Fonts was launched in 2010 to serve webfonts under open-source licenses. By 2016, more than 800 webfont families are available.[17]

Webfonts have become an important tool for web designers and as of 2016 a majority of sites use webfonts.[18]

File formats

TrueDoc

TrueDoc, while not specifically a webfont specification, was the first standard for embedding fonts. It was developed by the type foundry Bitstream in 1994, and became natively supported in Netscape Navigator 4, in 1996. Due to open source license restrictions, with Netscape unable to release Bitstream's source code, native support for the technology ended when Netscape Navigator 6 was released. An ActiveX plugin was available to add support for TrueDoc to Internet Explorer, but the technology had to compete against Microsoft's Embedded OpenType fonts, which had natively supported in their Internet Explorer browser since version 4.0.[19] Another impediment was the lack of open-source or free tool to create webfonts in TrueDoc format, whereas Microsoft made available a free Web Embedding Fonts Tool to create webfonts in their format.

Embedded OpenType

Internet Explorer has supported font embedding through the proprietary Embedded OpenType standard since version 4.0. It uses digital rights management techniques to help prevent fonts from being copied and used without a license. A simplified subset of EOT has been formalized under the name of CWT (Compatibility Web Type, formerly EOT-Lite)[20]

Scalable Vector Graphics

Web typography applies to SVG in two ways:

  1. All versions of the SVG 1.1 specification, including the SVGT subset, define a font module allowing the creation of fonts within an SVG document. Safari introduced support for many of these properties in version 3. Opera added preliminary support in version 8.0, with support for more properties in 9.0.
  2. The SVG specification lets CSS apply to SVG documents in a similar manner to HTML documents, and the @font-face rule can be applied to text in SVG documents. Opera added support for this in version 10,[21] and WebKit since version 325 also supports this method using SVG fonts only.

Scalable Vector Graphics Fonts

SVG fonts was a W3C standard of fonts using SVG graphic that became a subset of OpenType fonts.[22] It allowed multicolor[23] or animated fonts.[24] It was first a subset of SVG 1.1 specifications[25] but it has been deprecated[26] in the SVG 2.0 specification. The SVG fonts as independent format is supported by most browsers apart from IE and Firefox, and is deprecated in Chrome (and Chromium).[27] That's now generally deprecated; the standard that most browser vendor agreed with is SVG font subset included in OpenType (and then WOFF superset, see below), called SVGOpenTypeFonts.[28] Firefox has supported SVG OpenType since Firefox 26.

TrueType/OpenType

Main pages: TrueType and OpenType

Linking to industry-standard TrueType (TTF) and OpenType (TTF/OTF) fonts is supported by Mozilla Firefox 3.5+, Opera 10+,[29] Safari 3.1+,[30] and Google Chrome 4.0+.[31] Internet Explorer 9+ supports only those fonts with embedding permissions set to installable.[32]

Web Open Font Format

Main page: Web Open Font Format

The Web Open Font Format (WOFF) is essentially OpenType or TrueType with compression and additional metadata. WOFF is supported by Mozilla Firefox 3.6+,[33] Google Chrome 5+,[34][35] Opera Presto,[36] and is supported by Internet Explorer 9 (since March 14, 2011).[37] Support is available on Mac OS X Lion's Safari from release 5.1.

Unicode fonts

A Unicode font is a computer font that maps glyphs to code points defined in the Unicode Standard.[38] The vast majority of modern computer fonts use Unicode mappings, even those fonts which only include glyphs for a single writing system, or even only support the basic Latin alphabet. Fonts which support a wide range of Unicode scripts and Unicode symbols are sometimes referred to as "pan-Unicode fonts", although as the maximum number of glyphs that can be defined in a TrueType font is restricted to 65,535, it is not possible for a single font to provide individual glyphs for all defined Unicode characters (143,859 characters, with Unicode 13.0).

Only two fonts available by default on the Windows platform, Microsoft Sans Serif and Lucida Sans Unicode, provide a wide Unicode character repertoire.[needs update]

On free and open-source software platforms such as Linux, GNU Unifont and GNU FreeFont provide a wide range of characters. On ChromeOS, Google's Noto fonts support (or are planned to support) all the scripts encoded in the Unicode standard

Alternatives

A common hurdle in Web design is the design of mockups that include fonts that are not Web-safe. There are a number of solutions for situations like this. One common solution is to replace the text with a similar Web-safe font or use a series of similar-looking fallback fonts.

Another technique is image replacement. This practice involves overlaying text with an image containing the same text written in the desired font. This is good for aesthetic purposes, but prevents text selection, increases bandwidth use, is bad for search engine optimization, and makes the text inaccessible for users with disabilities.[citation needed]

In the past, Flash-based solutions such as sIFR were used. This is similar to image replacement techniques, though the text is selectable and rendered as a vector. However, this method requires the presence of a proprietary plugin on a client's system.

Another solution is using JavaScript to replace the text with VML (for Internet Explorer) or SVG (for all other browsers).[39]

See also

Notes


References

  1. Garaffa, Dave (2 September 1997). "Embedded Fonts In Microsoft IE4pr2". Internet.com. http://browserwatch.internet.com/news/story/microsoft265.html. 
  2. Cascading Style Sheets, level 1, W3C, 1996-12-17, http://www.w3.org/TR/CSS1/ 
  3. "Fonts", Cascading Style Sheets, level 2:CSS2 Specification (World Wide Web Consortium), 1998-05-12, http://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html, retrieved 2009-07-28 
  4. CSS2.1 Changes —C.2.97 Chapter 15 Fonts, World Wide Web Consortium, http://www.w3.org/TR/CSS21/changes.html#q104, retrieved 2010-01-30 
  5. CSS3 module: Web Fonts, World Wide Web Consortium, http://www.w3.org/TR/css3-webfonts, retrieved 2010-01-30 
  6. 6.0 6.1 "CSS2 specification", Fonts (World Wide Web Consortium), http://www.w3.org/TR/CSS2/fonts.html 
  7. Poole, Alex (2005-04-07). "Which Are More Legible: Serif or Sans Serif Typefaces?". http://alexpoole.info/blog/which-are-more-legible-serif-or-sans-serif-typefaces/. 
  8. "Ui-serif, ui-sans-serif, ui-monospace and ui-rounded values for font-family | Can I use... Support tables for HTML5, CSS3, etc". https://caniuse.com/extended-system-fonts. 
  9. Hill, Bill (2008-07-21), Font Embedding on the Web, Microsoft, http://blogs.msdn.com/b/ie/archive/2008/07/21/font-embedding-on-the-web.aspx 
  10. W3C team comment
  11. Microsoft's forgotten monopoly
  12. Web fonts: the view from the free world
  13. CSS @ Ten: The Next Big Thing
  14. WOFF File Format 1.0 Submission Request to W3C
  15. Galineau, Sylvain (2010-04-23), Meet WOFF, The Standard Web Font Format, Microsoft, http://blogs.msdn.com/b/ie/archive/2010/04/23/meet-woff-the-standard-web-font-format.aspx 
  16. WOFF conversion reference code, https://people.mozilla.org/~jkew/woff/, retrieved May 8, 2016 
  17. "The new Google Fonts database is a design geek's paradise". https://www.theverge.com/2016/6/15/11950320/google-fonts-website-redesign-2016. 
  18. Richard Fink (2016-09-06)Webfonts on the Prairie, Alist Apart
  19. Niederst, Jennifer (2001). Web design in a nutshell: a desktop quick reference (2nd ed.). O'Reilly. p. 36. ISBN 0-596-00196-7. https://archive.org/details/webdesigninnutsh00nied_0. Retrieved 20 March 2016. "what year was truedoc developed." 
  20. Daggett, John (2009-07-31), EOT-Lite File Format v.1.1, World Wide Web Consortium, http://lists.w3.org/Archives/Public/www-font/2009JulSep/0969.html, retrieved 2010-01-30 
  21. Mills, Chris (2008-12-04), Opera Presto 2.2 and Opera 10 — a first look, Opera Software, http://dev.opera.com/articles/view/presto-2-2-and-opera-10-a-first-look/#webfontssvg, retrieved 2010-01-30 
  22. SVG in OpenType, W3C, http://www.w3.org/2013/10/SVG_in_OpenType/, retrieved 2014-09-20 
  23. Colorful typography on the web: get ready for multicolor fonts, Pixel Ambacht, http://pixelambacht.nl/2014/multicolor-fonts/, retrieved 2014-09-20 
  24. Anymated Glyph Example, people.Mozilla, https://people.mozilla.org/~jkew/opentype-svg/soccer.html, retrieved 2014-09-20 
  25. Fonts, W3C, http://www.w3.org/TR/SVG/fonts.html, retrieved 2014-09-20 
  26. Fonts chapter, W3C, https://www.w3.org/TR/SVG2/changes.html#fonts, retrieved 2018-03-08 
  27. Can I Use SVG fonts, CanIuse, http://caniuse.com/svg-fonts, retrieved 2014-09-20 
  28. SVGOpenTypeFonts, Mozilla, https://wiki.mozilla.org/SVGOpenTypeFonts, retrieved 2014-09-20 
  29. Mills, Chris (2008-12-04), Opera Presto 2.2 and Opera 10 — a first look, Opera Developer Community, http://www.opera.com/docs/specs/presto22/#css, retrieved 2010-01-29 
  30. Marsal, Katie (2008-02-07), Apple's Safari 3.1 to support downloadable web fonts, more, AppleInsider, http://www.appleinsider.com/articles/08/02/07/apples_safari_3_1_to_support_downloadable_web_fonts_more.html, retrieved 2010-02-05 
  31. Irish, Paul (2010-01-25), Chrome and @font-face: It's here!, http://paulirish.com/2009/chrome-and-font-face-a-summary/ 
  32. Galineau, Sylvain (2010-07-15), The CSS Corner: Better Web Typography For Better Design, Microsoft, http://blogs.msdn.com/b/ie/archive/2010/07/15/the-css-corner-better-web-typography-for-better-design.aspx 
  33. Shapiro, Melissa (2009-10-20), Mozilla Supports Web Open Font Format, Mozilla, http://blog.mozilla.com/blog/2009/10/20/mozilla-supports-web-open-font-format/, retrieved 2010-02-05 
  34. Gilbertson, Scott (2010-04-26), Google Chrome to Support the Web Open Font Format, webmonkey, http://www.webmonkey.com/2010/04/google-chrome-to-support-the-web-open-font-format 
  35. Bug 38217 - [chromium] Add WOFF support, WebKit, https://bugs.webkit.org/show_bug.cgi?id=38217 
  36. Web specifications support in Opera Presto 2.7, Opera, http://www.opera.com/docs/specs/presto27/ 
  37. Galineau, Sylvain (2010-04-23), Meet WOFF, The Standard Web Font Format, Microsoft, http://blogs.msdn.com/ie/archive/2010/04/23/meet-woff-the-standard-web-font-format.aspx 
  38. "Fonts and keyboards". Unicode Consortium. 28 June 2017. https://www.unicode.org/faq/font_keyboard.html. 
  39. About Cufon

External links

  • W3C CSS Fonts Specification
  • List of RFC as mentioned in WOFF (draft of 2009-10-23):
    • RFC 1950 ZLIB Compressed Data Format Specification
    • RFC 2119 Key words for use in RFCs to Indicate Requirement Levels
    • RFC 4647 Matching of Language Tags