8000 csswg-drafts/css-fonts/Overview.html at 4607d16aee21ec83322c9329817cca926eda2721 · w3c/csswg-drafts · GitHub
Skip to content

Latest commit

 

History

History
7404 lines (5653 loc) · 273 KB

File metadata and controls

7404 lines (5653 loc) · 273 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang=en>
<head><meta content="text/html;charset=utf-8" http-equiv=Content-Type>
<title>CSS Fonts Module Level 3</title>
<!--
FIXME when publishing: copy the current default.css and link to
"default.css" rather than "../default.css"
-->
<link href="../default.css" rel=stylesheet type="text/css">
<link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<!-- I'm just experimenting here, don't get your bee in a bonnet -->
<!--
<script type="text/javascript" src="http://use.typekit.com/xon2bky.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
-->
<style type="text/css">
body, th, td, h1, h2, h3, h4, h5, h6 {
font-family: "myriad-pro", sans-serif !important;
}
body {
padding: 2em 70px 2em 70px;
}
p + p, p.mtb {
margin-top: 0.8em;
text-indent: 0px;
}
#bolderlighter {
width: 40%;
}
#bolderlighter th {
text-align: center;
}
#fontformats td, #eventhandlers td, #fontformats th, #eventhandlers th {
padding-right: 2em;
text-align: left;
}
dd {
margin-bottom: 1em;
}
#authors dd {
margin-bottom: 0;
}
#fontstylematchingalg {
list-style-type: lower-alpha;
}
#fontmatchingalg ul, #fontmatchingalg ol {
margin-top: 0.8em;
}
#fontmatchingalg li + li {
margin-top: 0.8em;
}
div.example {
padding: 1em;
margin-top: 1em;
}
div.example + div.example {
margin-top: 2em;
}
div.figure {
page-break-inside: avoid;
}
pre.prod { white-space: pre-wrap; margin: 1em 0 1em 2em }
div.featex {
width: 700px;
}
div.featex img {
margin: auto;
display: block;
}
span.tag {
font-family: monospace;
font-size: 120%;
}
ol ol {
list-style-type: lower-alpha;
}
.idl-code {
font-weight: bold;
color: #c50;
}
</style>
<link href="http://www.w3.org/StyleSheets/TR/W3C-CR.css" rel=stylesheet
type="text/css">
<script defer=defer
src="http://test.csswg.org/harness/annotate.js#CSS3-FONTS_DEV"
type="text/javascript"></script>
<body>
<div class=head> <!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
<h1>CSS Fonts Module Level 3</h1>
<h2 class="no-num no-toc" id=w3c-candidate-recommendation-3-october-2>W3C
Candidate Recommendation 3 October 2013</h2>
<dl id=authors>
<dt>This version:</dt>
<!-- <dd><a href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a> -->
<dd><a
href="http://www.w3.org/TR/2013/CR-css-fonts-3-20131003/">http://www.w3.org/TR/2013/CR-css-fonts-3-20131003/</a>
<dt>Latest version:
<dd><a
href="http://www.w3.org/TR/css-fonts-3/">http://www.w3.org/TR/css-fonts-3/</a>
<dt>Latest editor's draft:
<dd><a
href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
(<a
href="https://dvcs.w3.org/hg/csswg/log/tip/css-fonts/Fonts.html">change
log</a>)
<dt>Previous version:
<dd><a
href="http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/">http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/</a>
<dt>Issues List:
<dd><a href="http://www.w3.org/Style/CSS/Tracker/products/18">CSS3 Fonts
issues in Tracker</a>
<dd><a
href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&amp;product=CSS&amp;component=Fonts&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED">CSS3
Fonts issues in Bugzilla</a>
<dt>Discussion:
<dd><a
href="mailto:www-style@w3.org?subject=%5Bcss-fonts%5D%20feedback">www-style@w3.org</a>
with subject line “<kbd>[css-fonts] <var>… message topic
…</var></kbd>” (<a
href="http://lists.w3.org/Archives/Public/www-style/"
rel=discussion>archives</a>)
<dt>Test Suite:
<dd><a
href="http://test.csswg.org/suites/css3-fonts/nightly-unstable/">http://test.csswg.org/suites/css3-fonts/nightly-unstable/</a>
<dt>Editor:
<dd><a href="mailto:jdaggett@mozilla.com">John Daggett (Mozilla)</a>
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr
title="European Research Consortium for Informatics and
Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>,
<a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C
<a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a
href="http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> rules apply.</p>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id=abstract>Abstract</h2>
<p>This CSS3 module describes how font properties are specified and how
font resources are loaded dynamically. The contents of this specification
are a consolidation of content previously divided into <a
href="http://www.w3.org/TR/2002/WD-css3-fonts-20020802/">CSS3 Fonts</a>
and <a href="http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/">CSS3
Web Fonts</a> modules. The description of font load events was moved into
the <a href="http://dev.w3.org/csswg/css-font-load-events/">CSS3 Font Load
Events</a> module.
<h2 class="no-num no-toc" id=status>Status of this document</h2>
<!--begin-status-->
<p><em>This section describes the status of this document at the time of
its publication. Other documents may supersede this document. A list of
current W3C publications and the latest revision of this technical report
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
index at http://www.w3.org/TR/.</a></em>
<p>This document was produced by the <a
href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> as a <a
href="http://www.w3.org/Consortium/Process/tr#RecsCR">Candidate
Recommendation.</a>
<p>A Candidate Recommendation is a document that has been widely reviewed
and is ready for implementation. W3C encourages everybody to implement
this specification and return comments to the (<a
href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a
href="mailto:www-style@w3.org?Subject=%5Bcss3-fonts%5D%20PUT%20SUBJECT%20HERE">
www-style@w3.org</a> (see <a
href="http://www.w3.org/Mail/Request">instructions</a>). When sending
e-mail, please put the text “css3-fonts” in the subject, preferably
like this: “[<!---->css3-fonts<!---->] <em>…summary of
comment…</em>”
<p>Publication as a Candidate Recommendation does not imply endorsement by
the W3C Membership. This is a draft document and may be updated, replaced
or obsoleted by other documents at any time. It is inappropriate to cite
this document as other than work in progress.
<p>This document was produced by a group operating under the <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
2004 W3C Patent Policy</a>. W3C maintains a <a
href="http://www.w3.org/2004/01/pp-impl/32061/status"
rel=disclosure>public list of any patent disclosures</a> made in
connection with the deliverables of the group; that page also includes
instructions for disclosing a patent. An individual who has actual
knowledge of a patent which the individual believes contains <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">
Essential Claim(s)</a> must disclose the information in accordance with <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">
section 6 of the W3C Patent Policy</a>.</p>
<!--end-status-->
<p>See the section <a href="#cr-exit-criteria">CR Exit Criteria</a> for
details on advancing this specification to W3C Recommendation. The
specification will remain Candidate Recommendation at least until 3 April
2014. A <a
href="http://test.csswg.org/suites/css3-fonts/nightly-unstable/report/">test
suite and implementation report</a> are under development.
<h3 class="no-num no-toc" id=atrisk>Features at risk</h3>
<p>The following features are at risk; if interoperable implementations are
not found, they may be removed to advance the other features in this
specification to Proposed Recommendation:
<ul>
<li>fallback handling for text decoration in superscript/subscript variant
glyphs (‘<a href="#propdef-font-variant-position"><code
class=property>font-variant-position</code></a>’)
<li>‘<a href="#propdef-font-language-override"><code
class=property>font-language-override</code></a>’ property
</ul>
<h2 class="no-num no-toc" id=contents>Table of contents</h2>
<!--begin-toc-->
<ul class=toc>
<li><a href="#introduction"><span class=secno>1 </span>Introduction</a>
<li><a href="#typography-background"><span class=secno>2 </span>Typography
Background</a>
<li><a href="#basic-font-props"><span class=secno>3 </span>Basic Font
Properties</a>
<ul class=toc>
<li><a href="#font-family-prop"><span class=secno>3.1 </span>Font
family: the font-family property</a>
<ul class=toc>
<li><a href="#generic-font-families"><span class=secno>3.1.1
</span>Generic font families</a>
</ul>
<li><a href="#font-weight-prop"><span class=secno>3.2 </span>Font
weight: the font-weight property</a>
<li><a href="#font-stretch-prop"><span class=secno>3.3 </span>Font
width: the font-stretch property</a>
<li><a href="#font-style-prop"><span class=secno>3.4 </span>Font style:
the font-style property</a>
<li><a href="#font-size-prop"><span class=secno>3.5 </span>Font size:
the font-size property</a>
<li><a href="#font-size-adjust-prop"><span class=secno>3.6
</span>Relative sizing: the font-size-adjust property</a>
<li><a href="#font-prop"><span class=secno>3.7 </span>Shorthand font
property: the font property</a>
<li><a href="#font-synthesis-prop"><span class=secno>3.8
</span>Controlling synthetic faces: the font-synthesis property</a>
</ul>
<li><a href="#font-resources"><span class=secno>4 </span>Font
Resources</a>
<ul class=toc>
<li><a href="#font-face-rule"><span class=secno>4.1 </span>The
<code>@font-face</code> rule</a>
<li><a href="#font-family-desc"><span class=secno>4.2 </span>Font
family: the font-family descriptor</a>
<li><a href="#src-desc"><span class=secno>4.3 </span>Font reference: the
src descriptor</a>
<li><a href="#font-prop-desc"><span class=secno>4.4 </span>Font property
descriptors: the font-style, font-weight, font-stretch descriptors</a>
<li><a href="#unicode-range-desc"><span class=secno>4.5 </span>Character
range: the unicode-range descriptor</a>
<li><a href="#composite-fonts"><span class=secno>4.6 </span>Using
character ranges to define composite fonts</a>
<li><a href="#font-rend-desc"><span class=secno>4.7 </span>Font
features: the font-variant and font-feature-settings descriptors</a>
<li><a href="#font-face-loading"><span class=secno>4.8 </span>Font
loading guidelines</a>
<li><a href="#font-fetching-requirements"><span class=secno>4.9
</span>Font fetching requirements</a>
</ul>
<li><a href="#font-matching-algorithm"><span class=secno>5 </span>Font
Matching Algorithm</a>
<ul class=toc>
<li><a href="#font-family-casing"><span class=secno>5.1 </span>Case
sensitivity of font family names</a>
<li><a href="#font-style-matching"><span class=secno>5.2 </span>Matching
font styles</a>
<li><a href="#cluster-matching"><span class=secno>5.3 </span>Cluster
matching</a>
<li><a href="#char-handling-issues"><span class=secno>5.4
</span>Character handling issues</a>
<li><a href="#font-matching-changes"><span class=secno>5.5 </span>Font
matching changes since CSS 2.1</a>
<li><a href="#font-matching-examples"><span class=secno>5.6 </span>Font
matching examples</a>
</ul>
<li><a href="#font-rend-props"><span class=secno>6 </span>Font Feature
Properties</a>
<ul class=toc>
<li><a href="#glyph-selection-positioning"><span class=secno>6.1
</span>Glyph selection and positioning</a>
<li><a href="#language-specific-support"><span class=secno>6.2
</span>Language-specific display</a>
<li><a href="#font-kerning-prop"><span class=secno>6.3 </span>Kerning:
the font-kerning property</a>
<li><a href="#font-variant-ligatures-prop"><span class=secno>6.4
</span>Ligatures: the font-variant-ligatures property</a>
<li><a href="#font-variant-position-prop"><span class=secno>6.5
</span>Subscript and superscript forms: the font-variant-position
property</a>
<li><a href="#font-variant-caps-prop"><span class=secno>6.6
</span>Capitalization: the font-variant-caps property</a>
<li><a href="#font-variant-numeric-prop"><span class=secno>6.7
</span>Numerical formatting: the font-variant-numeric property</a>
<li><a href="#font-variant-alternates-prop"><span class=secno>6.8
</span>Alternates and swashes: the font-variant-alternates property</a>
<li><a href="#font-feature-values"><span class=secno>6.9 </span>Defining
font specific alternates: the <code>@font-feature-values</code>
rule</a>
<ul class=toc>
<li><a href="#basic-syntax"><span class=secno>6.9.1 </span>Basic
syntax</a>
<li><a href="#multi-valued-feature-value-definitions"><span
class=secno>6.9.2 </span>Multi-valued feature value definitions</a>
</ul>
<li><a href="#font-variant-east-asian-prop"><span class=secno>6.10
</span>East Asian text rendering: the font-variant-east-asian
property</a>
<li><a href="#font-variant-prop"><span class=secno>6.11 </span>Overall
shorthand for font rendering: the font-variant property</a>
<li><a href="#font-feature-settings-prop"><span class=secno>6.12
</span>Low-level font feature settings control: the
font-feature-settings property</a>
<li><a href="#font-language-override-prop"><span class=secno>6.13
</span>Font language override: the font-language-override property</a>
</ul>
<li><a href="#font-feature-resolution"><span class=secno>7 </span>Font
Feature Resolution </a>
<ul class=toc>
<li><a href="#default-features"><span class=secno>7.1 </span>Default
features</a>
<li><a href="#feature-precedence"><span class=secno>7.2 </span>Feature
precedence</a>
<li><a href="#feature-precedence-examples"><span class=secno>7.3
</span>Feature precedence examples</a>
</ul>
<li><a href="#object-model"><span class=secno>8 </span>Object Model</a>
<ul class=toc>
<li><a href="#om-fontface"><span class=secno>8.1 </span>The
<code>CSSFontFaceRule</code> interface</a>
<li><a href="#om-fontfeaturevalues"><span class=secno>8.2 </span>The
<code>CSSFontFeatureValuesRule</code> interface</a>
</ul>
<li class=no-num><a href="#platform-props-to-css">Appendix A: Mapping
platform font properties to CSS properties</a>
<li class=no-num><a href="#ch-ch-ch-changes">Changes</a>
<ul class=toc>
<li class=no-num><a href="#recent-changes"> Changes from the July 2013
CSS3 Fonts Last Call Working Draft</a>
</ul>
<li class=no-num><a href="#acknowledgments">Acknowledgments</a>
<li class=no-num><a href="#conformance"> Conformance</a>
<ul class=toc>
<li class=no-num><a href="#conventions"> Document Conventions</a>
<li class=no-num><a href="#conformance-classes"> Conformance Classes</a>
<li class=no-num><a href="#partial"> Partial Implementations</a>
<li class=no-num><a href="#experimental"> Experimental
Implementations</a>
<li class=no-num><a href="#testing"> Non-Experimental
Implementations</a>
<li class=no-num><a href="#cr-exit-criteria">CR Exit Criteria</a>
</ul>
<li class=no-num><a href="#references">References</a>
<ul class=toc>
<li class=no-num><a href="#normative-references">Normative
References</a>
<li class=no-num><a href="#other-references">Other References</a>
</ul>
<li class=no-num><a href="#index">Index</a>
<li class=no-num><a href="#property-index">Property index</a>
</ul>
<!--end-toc-->
<h2 id=introduction><span class=secno>1 </span>Introduction</h2>
<p>A font provides a resource containing the visual representation of
characters. At the simplest level it contains information that maps
character codes to shapes (called glyphs) that represent these characters.
Fonts sharing a common design style are commonly grouped into font
families classified by a set of standard font properties. Within a family,
the shape displayed for a given character can vary by stroke weight, slant
or relative width, among others. An individual font face is described by a
unique combination of these properties. For a given range of text, CSS
font properties are used to select a font family and a specific font face
within that family to be used when rendering that text. As a simple
example, to use the bold form of Helvetica one could use:
<pre>body {
font-family: Helvetica;
font-weight: bold;
}</pre>
<p>Font resources may be installed locally on the system on which a user
agent is running or downloadable. For local font resources descriptive
information can be obtained directly from the font resource. For
downloadable font resources (sometimes referred to as web fonts), the
descriptive information is included with the reference to the font
resource.
<p>Families of fonts typically don't contain a single face for each
possible variation of font properties. The CSS font selection mechanism
describes how to match a given set of CSS font properties to a single font
face.
<h2 id=typography-background><span class=secno>2 </span>Typography
Background</h2>
<p><em>This section is non-normative.</em>
<p> Typographic traditions vary across the globe, so there is no unique way
to classify all fonts across languages and cultures. For even common Latin
letters, wide variations are possible:
<div class=figure><img alt="variations in glyphs for a single character"
src=aaaaaa.png>
<p class=caption>One character, many glyph variations
</div>
<p>Differences in the anatomy of letterforms is one way to distinguish
fonts. For Latin fonts, flourishes at the ends of a character's main
strokes, or serifs, can distinguish a font from those without. Similar
comparisons exist in non-Latin fonts between fonts with tapered strokes
and those using primarily uniform strokes:
<div class=figure><img alt="serif vs. non-serifs" src=serifvssansserif.png>
<p class=caption>Letterforms with and without serifs
</div>
<div class=figure><img alt="serif vs. non-serifs for japanese"
src=minchovsgothic.png>
<p class=caption>Similar groupings for Japanese typefaces
</div>
<p>Fonts contain letterforms and the data needed to map characters to these
letterforms. Often this may be a simple one-to-one mapping, but more
complex mappings are also possible. The use of combining diacritic marks
creates many variations for an underlying letterform:
<div class=figure><img alt="diacritic marks" src=aaaaaa-diacritics.png>
<p class=caption>Variations with diacritic marks
</div>
<p>A sequence of characters can be represented by a single glyph known as a
ligature:
<div class=figure><img alt="example of a fi ligature"
src=final-ligature.png>
<p class=caption>Ligature example
</div>
<p>Visual transformations based on textual context are often stylistic
option in European languages. They are required to correctly render
languages like Arabic, the lam and alef characters below <em>must</em> be
combined when they exist in sequence:
<div class=figure><img alt="lam alef ligature" src=lamaleflig.png>
<p class=caption>Required Arabic ligature
</div>
<p>The relative complexity of these shaping transformations requires
additional data within the font.
<p>Sets of font faces with various stylistic variations are often grouped
together into font families. In the simplest case a regular face is
supplemented with bold and italic faces, but much more extensive groupings
are possible. Variations in the thickness of letterform strokes, the <dfn
id=weight>weight</dfn>, and the overall proportions of the letterform, the
<dfn id=width>width</dfn>, are most common. In the example below, each
letter uses a different font face within the Univers font family. The
width used increases from top to bottom and the weight increases from left
to right:
<div class=figure><img alt="various width and weight variations within a
single family" src=weightwidthvariations.png>
<p class=caption>Weight and width variations within a single font family
</div>
<p>Creating fonts that support multiple scripts is a difficult task;
designers need to understand the cultural traditions surrounding the use
of type in different scripts and come up with letterforms that somehow
share a common theme. Many languages often share a common script and each
of these languages may have noticeable stylistic differences. For example,
the Arabic script, when used for Persian and Urdu, exhibits significant
and systematic differences in letterforms, as does Cyrillic when used with
languages such as Serbian and Russian.
<p>The <a href="#character-map"><em>character map</em></a> of a font
defines the mapping of characters to glyphs for that font. If a document
contains characters not supported by the <a href="#character-map"><em
title="character map">character maps</em></a> of the fonts contained in a
font family list, a user agent may use a <a
href="#system-font-fallback"><em>system font fallback</em></a> procedure
to locate an appropriate font that does. If no appropriate font can be
found, some form of "missing glyph" character will be rendered by the user
agent. System fallback can occur when the specified list of font families
does not include a font that supports a given character.
<p>Although the <a href="#character-map"><em>character map</em></a> of a
font maps a given character to a glyph for that character, modern font
technologies such as OpenType and AAT (Apple Advanced Typography) provide
ways of mapping a character to different glyphs based upon feature
settings. Fonts in these formats allow these features to be embedded in
the font itself and controlled by applications. Common typographic
features which can be specified this way include ligatures, swashes,
contextual alternates, proportional and tabular figures, and automatic
fractions, to list just a few. For a visual overview of OpenType features,
see the <a href="#OPENTYPE-FONT-GUIDE"
rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
<h2 id=basic-font-props><span class=secno>3 </span>Basic Font Properties</h2>
<p>The particular font face used to render a character is determined by the
font family and other font properties that apply to a given element. This
structure allows settings to be varied independent of each other.</p>
<!-- prop: font-family -->
<h3 id=font-family-prop><span class=secno>3.1 </span>Font family: the <a
href="#propdef-font-family">font-family</a> property</h3>
<table class=propdef id=namefont-familyvalue-ltfamily-namegt-ltg>
<tbody>
<tr>
<td>Name:
<td><dfn id=propdef-font-family
title="font-family!!property">font-family</dfn>
<tr>
<td>Value:
<td>[ <a href="#family-name-value"><var>&lt;family-name&gt;</var></a> |
<a href="#generic-family-value"><var>&lt;generic-family&gt;</var></a> ]
#
<tr>
<td>Initial:
<td>depends on user agent
<tr>
<td>Applies to:
<td>all elements
<tr>
<td>Inherited:
<td>yes
<tr>
<td>Percentages:
<td>N/A
<tr>
<td>Media:
<td>visual
<tr>
<td>Computed value:
<td>as specified
<tr>
<td>Animatable:
<td>no
</table>
<p>This property specifies a prioritized list of font family names or
generic family names. A font family defines a set of faces that vary in
weight, width or slope. CSS uses the combination of a family name with
other style attributes to select an individual face. Using this selection
mechanism, rather than selecting a face via the style name as is often
done in design applications, allows some degree of regularity in textual
display when fallback occurs.
<p class=note>Designers should note that the CSS definition of font
attributes used for selection are explicitly not intended to define a font
taxonomy. A type designer's idea of a family may often extend to a set of
faces that vary along axes other than just the standard axes of weight,
width and slope. A family may extend to include both a set of serif faces
and a set of sans-serif faces or vary along axes that are unique to that
family. The CSS font selection mechanism merely provides a way to
determine the “closest” substitute when substitution is necessary.
<p>Unlike other CSS properties, component values are a comma-separated list
indicating alternatives. A user agent iterates through the list of family
names until it matches an available font that contains a glyph for the
character to be rendered. This allows for differences in available fonts
across platforms and for differences in the range of characters supported
by individual fonts.
<p>A font family name only specifies a name given to a set of font faces,
it does not specify an individual face. For example, given the
availability of the fonts below, Futura would match but Futura Medium
would not:
<div class=figure><img alt="family and face names"
src=familyvsfacename.png>
<p class=caption>Family and individual face names
</div>
<p>Consider the example below:
<div class=example>
<pre>body {
font-family: Helvetica, Verdana, sans-serif;
}</pre>
<p>If Helvetica is available it will be used when rendering. If neither
Helvetica nor Verdana is present, then the user-agent-defined sans serif
font will be used.</p>
</div>
<p>There are two types of font family names:
<dl>
<dt><dfn id=family-name-value><var>&lt;family-name&gt;</var></dfn>
<dd>The name of a font family of choice such as Helvetica or Verdana in
the previous example.
<dt><dfn id=generic-family-value><var>&lt;generic-family&gt;</var></dfn>
<dd> The following generic family keywords are defined: ‘<a
href="#serif"><code class=property>serif</code></a>’, ‘<a
href="#sans-serif"><code class=property>sans-serif</code></a>’, ‘<a
href="#cursive"><code class=property>cursive</code></a>’, ‘<a
href="#fantasy"><code class=property>fantasy</code></a>’, and ‘<a
href="#monospace"><code class=property>monospace</code></a>’. These
keywords can be used as a general fallback mechanism when an author's
desired font choices are not available. As keywords, they must not be
quoted. Authors are encouraged to append a generic font family as a last
alternative for improved robustness.
</dl>
<p>Font family names other than generic families must either be given
quoted as <a
href="http://www.w3.org/TR/CSS21/syndata.html#strings">strings,</a> or
unquoted as a sequence of one or more <a
href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifiers.</a>
This means most punctuation characters and digits at the start of each
token must be escaped in unquoted font family names.
<p>To illustrate this, the following declarations are invalid:
<pre>
font-family: Red/Black, sans-serif;
font-family: "Lucida" Grande, sans-serif;
font-family: Ahem!, sans-serif;
font-family: test@foo, sans-serif;
font-family: #POUND, sans-serif;
font-family: Hawaii 5-0, sans-serif;
</pre>
<p>If a sequence of identifiers is given as a font family name, the
computed value is the name converted to a string by joining all the
identifiers in the sequence by single spaces.
<p>To avoid mistakes in escaping, it is recommended to quote font family
names that contain white space, digits, or punctuation characters other
than hyphens:
<pre>
body { font-family: "New Century Schoolbook", serif }
&lt;BODY STYLE="font-family: '21st Century', fantasy">
</pre>
<p>Font family <em>names</em> that happen to be the same as a keyword value
(‘<code class=property>inherit</code>’, ‘<a href="#serif"><code
class=property>serif</code></a>’, ‘<a href="#sans-serif"><code
class=property>sans-serif</code></a>’, ‘<a href="#monospace"><code
class=property>monospace</code></a>’, ‘<a href="#fantasy"><code
class=property>fantasy</code></a>’, and ‘<a href="#cursive"><code
class=property>cursive</code></a>’) must be quoted to prevent confusion
with the keywords with the same names. The keywords ‘<code
class=property>initial</code>’ and ‘<code
class=property>default</code>’ are reserved for future use and must also
be quoted when used as font names. UAs must not consider these keywords as
matching the <a
href="#family-name-value"><var>&lt;family-name&gt;</var></a> type.
<p>The precise way a set of fonts are grouped into font families varies
depending upon the platform font management API's. The Windows GDI API
only allows four faces to be grouped into a family while the DirectWrite
API and API's on OSX and other platforms support font families with a
variety of weights, widths and slopes (see <a
href="#platform-props-to-css">Appendix A</a> for more details).
<p>Some font formats allow fonts to carry multiple localizations of the
family name. User agents must recognize and correctly match all of these
names independent of the underlying platform localization, system API used
or document encoding:
<div class=figure><img alt="examples of localized family names"
src=localizedfamilynames.png>
<p class=caption>Localized family names
</div>
<p>The details of localized font family name matching and the corresponding
issues of case sensitivity are described below in the <a
href="#font-family-casing">font matching</a> section.
<h4 id=generic-font-families><span class=secno>3.1.1 </span>Generic font
families</h4>
<p>All five g B989 eneric font families are defined to exist in all CSS
implementations (they need not necessarily map to five distinct actual
fonts). User agents should provide reasonable default choices for the
generic font families, which express the characteristics of each family as
well as possible within the limits allowed by the underlying technology.
User agents are encouraged to allow users to select alternative choices
for the generic fonts.
<h5 class="no-num no-toc"> <span class=index-def id=serif0 title="serif,
definition of"><a name=serif-def><dfn id=serif>serif</dfn></a></span></h5>
<p>Serif fonts represent the formal text style for a script. This often
means but is not limited to glyphs that have finishing strokes, flared or
tapering ends, or have actual serifed endings (including slab serifs).
Serif fonts are typically proportionately-spaced. They often display a
greater variation between thick and thin strokes than fonts from the ‘<a
href="#sans-serif"><code class=property>sans-serif</code></a>’ generic
font family. CSS uses the term ‘<a href="#serif"><code
class=property>serif</code></a>’ to apply to a font for any script,
although other names may be more familiar for particular scripts, such as
Mincho (Japanese), Sung, Song or Kai (Chinese), Batang (Korean). For
Arabic, the Naskh style would correspond to ‘<a href="#serif"><code
class=property>serif</code></a>’ more due to its typographic role rather
than its actual design style. Any font that is so described may be used to
represent the generic ‘<a href="#serif"><code
class=property>serif</code></a>’ family.
<div class=figure><img alt="sample serif fonts" src=serifexamples.png>
<p class=caption>Sample serif fonts
</div>
<h5 class="no-num no-toc"> <span class=index-def id=sans-serif0
title="sans-serif, definition of"> <a name=sans-serif-def><dfn
id=sans-serif>sans-serif</dfn></a></span></h5>
<p>Glyphs in sans-serif fonts, as the term is used in CSS, are generally
low contrast (vertical and horizontal stems have the close to the same
thickness) and have stroke endings that are plain -- without any flaring,
cross stroke, or other ornamentation. Sans-serif fonts are typically
proportionately-spaced. They often have little variation between thick and
thin strokes, compared to fonts from the ‘<a href="#serif"><code
class=property>serif</code></a>’ family. CSS uses the term ‘<a
href="#sans-serif"><code class=property>sans-serif</code></a>’ to apply
to a font for any script, although other names may be more familiar for
particular scripts, such as Gothic (Japanese), Hei (Chinese), or Gulim
(Korean). Any font that is so described may be used to represent the
generic ‘<a href="#sans-serif"><code
class=property>sans-serif</code></a>’ family.
<div class=figure><img alt="sample sans-serif fonts"
src=sansserifexamples.png>
<p class=caption>Sample sans-serif fonts
</div>
<h5 class="no-num no-toc"> <span class=index-def id=cursive0
title="cursive, definition of"> <a name=cursive-def><dfn
id=cursive>cursive</dfn></a></span></h5>
<p>Glyphs in cursive fonts generally use a more informal script style, and
the result looks more like handwritten pen or brush writing than printed
letterwork. CSS uses the term ‘<a href="#cursive"><code
class=property>cursive</code></a>’ to apply to a font for any script,
although other names such as Chancery, Brush, Swing and Script are also
used in font names.
<div class=figure><img alt="sample cursive fonts" src=cursiveexamples.png>
<p class=caption>Sample cursive fonts
</div>
<h5 class="no-num no-toc"> <span class=index-def id=fantasy0
title="fantasy, definition of"> <a name=fantasy-def><dfn
id=fantasy>fantasy</dfn></a></span></h5>
<p>Fantasy fonts are primarily decorative or expressive fonts that contain
decorative or expressive representations of characters. These do not
include Pi or Picture fonts which do not represent actual characters.
<div class=figure><img alt="sample fantasy fonts" src=fantasyexamples.png>
<p class=caption>Sample fantasy fonts
</div>
<h5 class="no-num no-toc"> <span class=index-def id=monospace0
title="monospace, definition of"> <a name=monospace-def><dfn
id=monospace>monospace</dfn></a></span></h5>
<p>The sole criterion of a monospace font is that all glyphs have the same
fixed width. This is often used to render samples of computer code.
<div class=figure><img alt="sample monospace fonts"
src=monospaceexamples.png>
<p class=caption>Sample monospace fonts
</div>
<!-- prop: font-weight -->
<h3 id=font-weight-prop><span class=secno>3.2 </span>Font weight: the <a
href="#propdef-font-weight">font-weight</a> property</h3>
<table class=propdef id=namefont-weightvaluenormal-bold-bolder-l>
<tbody>
<tr>
<td>Name:
<td><dfn id=propdef-font-weight
title="font-weight!!property">font-weight</dfn>
<tr>
<td>Value:
<td><a href="#font-weight-normal-value"
title="normal!!font-weight">normal</a> | <a href="#bold">bold</a> | <a
href="#bolder">bolder</a> | <a href="#lighter">lighter</a> | <a
href="#font-weight-numeric-values" title="100...900 weight
values">100</a> | <a href="#font-weight-numeric-values"
title="100...900 weight values">200</a> | <a
href="#font-weight-numeric-values" title="100...900 weight
values">300</a> | <a href="#font-weight-numeric-values"
title="100...900 weight values">400</a> | <a
href="#font-weight-numeric-values" title="100...900 weight
values">500</a> | <a href="#font-weight-numeric-values"
title="100...900 weight values">600</a> | <a
href="#font-weight-numeric-values" title="100...900 weight
values">700</a> | <a href="#font-weight-numeric-values"
title="100...900 weight values">800</a> | <a
href="#font-weight-numeric-values" title="100...900 weight
values">900</a>
<tr>
<td>Initial:
<td>normal
<tr>
<td>Applies to:
<td>all elements
<tr>
<td>Inherited:
<td>yes
<tr>
<td>Percentages:
<td>N/A
<tr>
<td>Media:
<td>visual
<tr>
<td>Computed value:
<td>numeric weight value (see description)
<tr>
<td>Animatable:
<td>as <a
href="http://dev.w3.org/csswg/css-transitions/#animtype-font-weight">font
weight</a>
</table>
<p>The <a href="#propdef-font-weight"
title="font-weight!!property">‘<code
class=property>font-weight</code>’</a> property specifies the weight of
glyphs in the font, their degree of blackness or stroke thickness.
<p>Values have the following meanings:
<dl>
<dt><dfn id=font-weight-numeric-values title="100...900 weight values">100
to 900</dfn>
<dd>These values form an ordered sequence, where each number indicates a