22.12.2013 Views

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

15.2.2 Font family: the ’font-family’ property<br />

’font-family’<br />

Value: [[ | ],]* [ |<br />

] | inherit<br />

Initial: depends on user agent<br />

Applies to: all elements<br />

Inherited: yes<br />

Percentages: N/A<br />

Media: visual<br />

This property specifies a prioritized list of font family names and/or generic<br />

family names. To deal with the problem that a single font may not contain glyphs<br />

to display all the characters in a document, or that not all fonts are available on<br />

all systems, this property allows authors to specify a list of fonts, all of the same<br />

style and size, that are tried in sequence to see if they contain a glyph for a<br />

certain character. This list is called a font set.<br />

Example(s):<br />

For example, text that contains English words mixed with mathematical<br />

symbols may need a font set of two fonts, one containing Latin letters and digits,<br />

the other containing mathematical symbols. Here is an example of a font set suitable<br />

for a text that is expected to contain text with Latin characters, Japanese<br />

characters, and mathematical symbols:<br />

BODY { font-family: Baskerville, "Heisi Mincho W3", Symbol, serif }<br />

The glyphs available in the "Baskerville" font (a font that covers only Latin<br />

characters) will be taken from that font, Japanese glyphs will be taken from "Heisi<br />

Mincho W3", and the mathematical symbol glyphs will come from "Symbol". Any<br />

others will come from the generic font family ’serif’.<br />

The generic font family will be used if one or more of the other fonts in a font<br />

set is unavailable. Although many fonts provide the "missing character" glyph,<br />

typically an open box, as its name implies this should not be considered a match<br />

except for the last font in a font set.<br />

There are two types of font family names:<br />

<br />

The name of a font family of choice. In the previous example, "Baskerville",<br />

"Heisi Mincho W3", and "Symbol" are font families. Font family names<br />

containing whitespace [p. 37] should be quoted. If quoting is omitted, any<br />

whitespace [p. 37] characters before and after the font name are ignored<br />

[p. 42] and any sequence of whitespace characters inside the font name is<br />

converted to a single space.<br />

<br />

The following generic families are defined: ’serif’, ’sans-serif’, ’cursive’,<br />

’fantasy’, and ’monospace’. Please see the section on generic font families<br />

[p. 209] for descriptions of these families. Generic font family names are<br />

keywords, and therefore must not be quoted.<br />

199

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!