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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

15.4.19 Vertical stem width<br />

This is the width of vertical (or near-vertical) stems of glyphs. This information is<br />

often tied to hinting, and may not be directly accessible in some font formats. The<br />

measurement should be for the dominant vertical stem in the font because there<br />

might be different groupings of vertical stems (e.g., one main one, and one lighter<br />

weight one as for an uppercase M or N).<br />

15.4.20 Vertical stroke angle<br />

This is the angle, in degrees counterclockwise from the vertical, of the dominant<br />

vertical strokes of the font. The value is negative for fonts that slope to the right,<br />

as almost all italic fonts do. This descriptor may also be specified for oblique<br />

fonts, slanted fonts, script fonts, and in general for any font whose vertical<br />

strokes are not precisely vertical. A non-zero value does not of itself indicate an<br />

italic font.<br />

15.5 Font matching algorithm<br />

This specification extends the algorithm given in the CSS1 specification. This<br />

algorithm reduces down to the algorithm in the CSS1 specification when the<br />

author and reader style sheets do not contain any @font-face rules.<br />

Matching of descriptors to font faces must be done carefully. The descriptors<br />

are matched in a well-defined order to insure that the results of this matching<br />

process are as consistent as possible across UAs (assuming that the same<br />

library of font faces and font descriptions is presented to each of them). This<br />

algorithm may be optimized, provided that an implementation behaves as if the<br />

algorithm had been followed exactly.<br />

1. The user agent makes (or accesses) a database of relevant font-face<br />

descriptors of all the fonts of which the UA is aware. If there are two fonts<br />

with exactly the same descriptors, one of them is ignored. [p. 42] The UA<br />

may be aware of a font because:<br />

it has been installed locally<br />

it is declared using an @font-face rule in one of the style sheets linked<br />

to or contained in the current document<br />

it is used in the UA default style sheet, which conceptually exists in all<br />

UAs and is considered to have full @font-face rules for all fonts which<br />

the UA will use for default presentation, plus @font-face rules for the<br />

five special generic font families (see ’font-family’) defined in <strong>CSS2</strong><br />

2. At a given element and for each character in that element, the UA assembles<br />

the font properties applicable to that element. Using the complete set of<br />

properties, the UA uses the ’font-family’ descriptor to choose a tentative font<br />

family. Thus, matching on a family name will succeed before matching on<br />

some other descriptor. The remaining properties are tested against the<br />

family according to the matching criteria described with each descriptor. If<br />

there are matches for all the remaining properties, then that is the matching<br />

font face for the given element.<br />

3. If there is no matching font face within the ’font-family’ being processed by<br />

step 2, UAs that implement intelligent matching may proceed to examine<br />

231

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

Saved successfully!

Ooh no, something went wrong!