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.

In the <strong>CSS2</strong> font model, as in CSS1, each user agent has a "font database" at<br />

its disposition. CSS1 referred to this database but gave no details about what<br />

was in it. <strong>CSS2</strong> defines the information in that database and allows style sheet<br />

authors to contribute to it. When asked to display a character with a particular<br />

font, the user agent first identifies the font in the database that "best fits" the<br />

specified font (according to the font matching algorithm) [p. 231] Once it has<br />

identified a font, it retrieves the font data locally or from the Web, and may<br />

display the character using those glyphs.<br />

In light of this model, we have organized the specification into two sections.<br />

The first concerns the font specification mechanism [p. 197] , whereby authors<br />

specify which fonts they would like to have used. The second concerns the font<br />

selection mechanism [p. 212] , whereby the client’s user agent identifies and<br />

loads a font that best fits the author’s specification.<br />

How the user agent constructs the font database lies outside the scope of this<br />

specification since the database’s implementation depends on such factors as<br />

the operating system, the windowing system, and the client.<br />

15.2 Font specification<br />

The first phase of the CSS font mechanism concerns how style sheet authors<br />

specify which fonts should be used by a user agent. At first, it seem that the<br />

obvious way to specify a font is by it’s name, a single string - which appears to be<br />

separated into distinct parts; for example "BT Swiss 721 Heavy Italic".<br />

Unfortunately, there exists no well-defined and universally accepted taxonomy<br />

for classifying fonts based on their names, and terms that apply to one font family<br />

name may not be appropriate for others. For example, the term ’italic’ is<br />

commonly used to label slanted text, but slanted text may also be labeled<br />

Oblique, Slanted, Incline, Cursive, or Kursiv. Similarly, font names typically<br />

contain terms that describe the "weight" of a font. The primary role of these<br />

names is to distinguish faces of differing darkness within a single font family.<br />

There is no accepted, universal meaning to these weight names and usage<br />

varies widely. For example a font that you might think of as being bold might be<br />

described as being Regular, Roman, Book, Medium, Semi- or Demi-Bold, Bold,<br />

or Black, depending on how black the "normal" face of the font is within the<br />

design.<br />

This lack of systematic naming makes it impossible, in the general case, to<br />

generate a modified font face name that differs in a particular way, such as being<br />

bolder.<br />

Because of this, CSS uses a different model [p. 198] . Fonts are requested not<br />

through a single font name but through setting a series of font properties. These<br />

property values form the basis of the user agent’s font selection [p. 212] mechanism.<br />

The font properties can be individually modified, for example to increase<br />

the boldness, and the new set of font property values will then be used to select<br />

from the font database again. The result is an increase in regularity for style<br />

sheet authors and implementors, and an increase in robustness.<br />

197

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

Saved successfully!

Ooh no, something went wrong!