111111
112112 < h1 > CSS Fonts Module Level 3</ h1 >
113113
114- < h2 class ="no-num no-toc " id =editors-draft-9 -march-2011 > Editor's Draft 9
114+ < h2 class ="no-num no-toc " id =editors-draft-10 -march-2011 > Editor's Draft 10
115115 March 2011</ h2 >
116116
117117 < dl id =authors >
118118 < dt > This version:
119119
120120 < dd > < a
121121 href ="http://dev.w3.org/csswg/css3-fonts/ "> http://dev.w3.org/csswg/css3-fonts/</ a >
122- <!-- <dd><a href="http://www.w3.org/TR/2011/ED-css3-fonts-20110309 ">http://www.w3.org/TR/2011/ED-css3-fonts-20110309 </a> -->
122+ <!-- <dd><a href="http://www.w3.org/TR/2011/ED-css3-fonts-20110310 ">http://www.w3.org/TR/2011/ED-css3-fonts-20110310 </a> -->
123123
124124
125125 < dt > Latest version:
@@ -292,6 +292,9 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
292292
293293 < li > < a href ="#char-handling-issues "> < span class =secno > 5.2
294294 </ span > Character handling issues</ a >
295+
296+ < li > < a href ="#font-matching-changes "> < span class =secno > 5.3 </ span > Font
297+ matching changes since CSS 2.1</ a >
295298 </ ul >
296299
297300 < li > < a href ="#font-rend-props "> < span class =secno > 6 </ span > Font feature
@@ -334,8 +337,8 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
334337 shorthand for font rendering: the font-variant property</ a >
335338
336339 < li > < a href ="#font-feature-settings-prop "> < span class =secno > 6.12
337- </ span > Low-level font settings control: the font-feature-settings
338- property</ a >
340+ </ span > Low-level font feature settings control: the
341+ font-feature-settings property</ a >
339342
340343 < li > < a href ="#font-language-override-prop "> < span class =secno > 6.13
341344 </ span > Font language override: the font-language-override property</ a >
@@ -2577,7 +2580,7 @@ <h3 id=font-rend-desc><span class=secno>4.6 </span>Font features: the <a
25772580 < tr >
25782581 < td > Value:
25792582
2580- < td > normal | [ <featuretag >]+
2583+ < td > normal | <featuretagvalue> [, <featuretagvalue >]*
25812584
25822585 < tr >
25832586 < td > < em > Initial:</ em >
@@ -2779,7 +2782,29 @@ <h3 id=char-handling-issues><span class=secno>5.2 </span>Character handling
27792782 implementation behaves as if the algorithm had been followed exactly.
27802783 Matching occurs in a well-defined order to insure that the results are as
27812784 consistent as possible across user agents, given an identical set of
2782- available fonts and rendering technology.</ p >
2785+ available fonts and rendering technology.
2786+
2787+ < h3 id =font-matching-changes > < span class =secno > 5.3 </ span > Font matching
2788+ changes since CSS 2.1</ h3 >
2789+
2790+ < p > The algorithm above is different from CSS 2.1 in a number of key places.
2791+ These changes were made to better reflect actual font matching behavior
2792+ across user agent implementations.
2793+
2794+ < ul > </ ul >
2795+
2796+ < p > Differences compared to the font matching algorithm in CSS 2.1:
2797+
2798+ < ul >
2799+ < li > The algorithm includes font-stretch matching.
2800+
2801+ < li > All possible font-style matching scenarios are delineated.
2802+
2803+ < li > Small-caps fonts are not matched as part of the font matching process,
2804+ they are now handled via font features.
2805+
2806+ < li > Unicode variation selector matching is required.
2807+ </ ul >
27832808 <!--
27842809
27852810<h3>Examples of font matching</h3>
@@ -3008,20 +3033,23 @@ <h3 id=font-kerning-prop><span class=secno>6.3 </span>Kerning: the <a
30083033 < td > as specified
30093034 </ table >
30103035
3011- < p > Controls whether kerning is applied to inter-glyph spacing when
3012- rendering text. The value ‘< code class =property > normal</ code > ’ implies
3013- that kerning is applied when rendering text while the value ‘< code
3036+ < p > Kerning is the contextual adjustment of inter-glyph spacing. This
3037+ property controls metric kerning, kerning that utilizes adjustment data
3038+ contained in the font. The value ‘< code class =property > normal</ code > ’
3039+ implies that kerning is applied while the value ‘< code
30143040 class =property > none</ code > ’ implies that kerning is not applied when
3015- rendering text. If the value is ‘< code class =property > auto</ code > ’ a
3041+ rendering text. If the value is ‘< code class =property > auto</ code > ’, a
30163042 user agent is free to choose whether kerning is enabled or not by default.
3017-
30183043
30193044 < p > For fonts that do not include kerning data this property will have no
30203045 visible effect. When rendering with OpenType fonts, the < a
30213046 href ="#OPENTYPE " rel =biblioentry > [OPENTYPE]<!--{{!OPENTYPE}}--> </ a >
3022- specification suggests that kerning be enabled by default. Authors may
3023- prefer to disable kerning in situations where performance is more
3024- important that precise appearance. If the ‘< code
3047+ specification suggests that kerning be enabled by default. For OpenType
3048+ fonts, user agents must support fonts containing kerning data in either
3049+ the ‘< code class =property > kern</ code > ’ or 'GPOS' tables, using the
3050+ guidelines detailed in the OpenType specification. Authors may prefer to
3051+ disable kerning in situations where performance is more important that
3052+ precise appearance. If the ‘< code
30253053 class =property > letter-spacing</ code > ’ property is defined, kerning
30263054 adjustments are considered part of the default spacing, letter spacing
30273055 adjustments are made after kerning has been applied.</ p >
@@ -3103,6 +3131,20 @@ <h3 id=vertical-position-prop><span class=secno>6.4 </span>Subscript,
31033131 and vertical-align to its initial value. Other than this, the property
31043132 does not affect the height of the line box.
31053133
3134+ < p class =issue > It would be nice to define this in a way such that it would
3135+ work with nested subscripts or superscripts which would allow it to be
3136+ used in user agent stylesheets. But one of the goals for this is to allow
3137+ simple subscripts and superscripts to be displayed without affecting the
3138+ line box. To achieve both appears to be a very hairy problem.
3139+
3140+ < p class =issue > Fonts often include default values for subscript/superscript
3141+ metrics. As a result, a mixture of designed glyphs and simulated glyphs
3142+ may not display correctly, effectively the baseline would bounce between
3143+ the two types of glyphs.
3144+
3145+ < p class =issue > Steve Z is concerned about the fact that this property
3146+ effectively breaks inheritance by resetting font-size and vertical-align.
3147+
31063148 < div class =example >
31073149 < p > A typical user agent default style for the < code > sub</ code > element:</ p >
31083150
@@ -3559,7 +3601,6 @@ <h3 id=font-variant-alternates-prop><span class=secno>6.8 </span>Alternates
35593601 styleset(<feature-value-name> [, <feature-value-name>]*) ||
35603602 character-variant(<feature-value-name>
35613603 [,<feature-value-name>]*) || swash(<feature-value-name>) ||
3562- contextual-swash(<feature-value-name>) ||
35633604 ornament(<feature-value-name>) ||
35643605 annotation(<feature-value-name>) || ruby ]
35653606
@@ -3662,19 +3703,13 @@ <h3 id=font-variant-alternates-prop><span class=secno>6.8 </span>Alternates
36623703 id =swashltfeature-value-namegt > swash(<feature-value-name>)</ dfn >
36633704
36643705 < dd > Enables display of swash glyphs (< em > font specific</ em > , OpenType
3665- feature: < code > swsh <feature-index></ code > ).
3706+ feature: < code > swsh <feature-index>, cswh
3707+ <feature-index></ code > ).
36663708 </ dl >
36673709
36683710 < div class =featex > < img alt ="swash example " src =swsh.png > </ div >
36693711
36703712 < dl >
3671- < dt > < dfn
3672- id =contextual-swashltfeature-value-namegt > contextual-swash(<feature-value-name>)</ dfn >
3673-
3674-
3675- < dd > Enables display of contextual swash glyphs (< em > font specific</ em > ,
3676- OpenType feature: < code > cswh <feature-index></ code > ).
3677-
36783713 < dt > < dfn
36793714 id =ornamentsltfeature-value-namegt > ornaments(<feature-value-name>)</ dfn >
36803715
@@ -3913,7 +3948,7 @@ <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
39133948 containing character variants that mimic the character forms found on a
39143949 Byzantine seal from the 8th century A.D. Two lines below is the same text
39153950 displayed in a font without variants. Note the two variants for U and N
3916- used on the reverse of the seal.</ p >
3951+ used on the seal.</ p >
39173952
39183953 < pre > @font-feature-values Athena Ruby {
39193954 @character-variant
@@ -4087,12 +4122,11 @@ <h3 id=font-variant-prop><span class=secno>6.11 </span>Overall shorthand
40874122 <contextual-alt-values> || stylistic[(<integer>)]? ||
40884123 historical-forms || styleset(<integer> [,<integer>]*) ||
40894124 character-variant(<integer> [,<integer>]*) ||
4090- swash[(<integer>)]? || contextual-swash[(<integer>)]? ||
4091- ornament[(<integer>)]? || annotation[(<integer>)]? || ruby
4092- || <caps-value> || <numeric-figure-values> ||
4093- <numeric-spacing-values> || <numeric-fraction-values> ||
4094- slashed-zero || <east-asian-variant-values> ||
4095- <east-asian-width-values> ]
4125+ swash[(<integer>)]? || ornament[(<integer>)]? ||
4126+ annotation[(<integer>)]? || ruby || <caps-value> ||
4127+ <numeric-figure-values> || <numeric-spacing-values> ||
4128+ <numeric-fraction-values> || slashed-zero ||
4129+ <east-asian-variant-values> || <east-asian-width-values> ]
40964130
40974131 < tr >
40984132 < td > Initial:
@@ -4137,7 +4171,7 @@ <h3 id=font-variant-prop><span class=secno>6.11 </span>Overall shorthand
41374171 class =property > font-feature-settings</ code > </ a > ’.
41384172
41394173 < h3 id =font-feature-settings-prop > < span class =secno > 6.12 </ span > Low-level
4140- font settings control: the < a
4174+ font feature settings control: the < a
41414175 href ="#propdef-font-feature-settings "> font-feature-settings</ a > property</ h3 >
41424176
41434177 < table class =propdef id =namefont-feature-settingsvaluenormal-ltf >
@@ -4150,7 +4184,7 @@ <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
41504184 < tr >
41514185 < td > Value:
41524186
4153- < td > normal | [ <featuretag >]+
4187+ < td > normal | <featuretagvalue> [, <featuretagvalue >]*
41544188
41554189 < tr >
41564190 < td > Initial:
@@ -4192,48 +4226,45 @@ <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
41924226 < p >
41934227
41944228 < pre > /* enable small caps and use second swash alternate */
4195- font-feature-settings: smcp swsh(2) ;</ pre >
4229+ font-feature-settings: " smcp", " swsh" 2 ;</ pre >
41964230
4197- < p > Feature tags are used with the following syntax:
4231+ < p > Feature tag values have the following syntax:
41984232
41994233 < pre
4200- class =prod > < dfn id =ltfeaturetaggt > < var > <featuretag></ var > </ dfn > = [ot-]ident[( <integer> | on | off )]?</ pre >
4201-
4202- < p > The identifier indicates a case-sensitive OpenType feature tag. For it
4203- to match an OpenType feature contained in a font, it must follow the
4204- syntax rules for tags. OpenType feature tags that are not valid CSS
4205- identifiers or conflict with CSS keywords must be prefixed with ‘< code
4206- class =property > ot-</ code > ’. In this case the ‘< code
4207- class =property > ot-</ code > ’ prefex is removed and the remaining portion
4208- of the identifier is used to lookup the feature tag in the font. Feature
4209- tags need only match a feature tag defined in the font, they are not
4210- limited to explicitly registered OpenType features. Fonts defining custom
4211- feature tags should follow the < a
4234+ class =prod > < dfn id =ltfeaturetagvaluegt > < var > <featuretagvalue></ var > </ dfn > = <string> [ <integer> | on | off ]?</ pre >
4235+
4236+ < p > The <string> is a case-sensitive OpenType feature tag. For it to
4237+ match an OpenType feature contained in a font, it must follow the syntax
4238+ rules for tags. As specified in the OpenType specification, feature tags
4239+ contain four characters. Tag strings longer than four characters must be
4240+ ignored, user agents must not use a feature tag created by truncating the
4241+ string to four characters. Feature tags need only match a feature tag
4242+ defined in the font, they are not limited to explicitly registered
4243+ OpenType features. Fonts defining custom feature tags should follow the < a
42124244 href ="http://www.microsoft.com/typography/otspec/featuretags.htm "> tag name
42134245 rules</ a > defined in the OpenType specification < a
42144246 href ="#OPENTYPE-FEATURES "
42154247 rel =biblioentry > [OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--> </ a > .
42164248 Feature tags not present in the font are ignored; a user agent must not
42174249 attempt to synthesize fallback behavior based on these feature tags.
42184250
4219- < p > If present, a value in parentheses indicates an index used for glyph
4220- selection. An <integer> value must be 0 or greater. A value of 0
4221- indicates that the feature is disabled. For boolean features, a value of 1
4222- enables the feature. For non-boolean features, a value of 1 or greater
4223- enables the feature and indicates the feature selection index. A value of
4224- ‘ < code class =property > on</ code > ’ is synonymous with 1 and ‘< code
4225- class =property > off</ code > ’ is synonymous with 0. If the value in
4226- parentheses is omitted, a value of 1 is assumed.
4251+ < p > If present, a value indicates an index used for glyph selection. An
4252+ <integer> value must be 0 or greater. A value of 0 indicates that
4253+ the feature is disabled. For boolean features, a value of 1 enables the
4254+ feature. For non-boolean features, a value of 1 or greater enables the
4255+ feature and indicates the feature selection index. A value of ‘ < code
4256+ class =property > on</ code > ’ is synonymous with 1 and ‘< code
4257+ class =property > off</ code > ’ is synonymous with 0. If the value is
4258+ omitted, a value of 1 is assumed.
42274259
42284260 < pre >
4229- font-feature-settings: dlig(1); /* dlig=1 enable discretionary ligatures */
4230- font-feature-settings: smcp(on); /* smcp=1 enable small caps */
4231- font-feature-settings: ot-c2sc; /* c2sc=1 enable caps to small caps */
4232- font-feature-settings: liga(off); /* liga=0 no common ligatures */
4233- font-feature-settings: tnum hist; /* tnum=1, hist=1 enabled tabular numbers and historical forms */
4234- font-feature-settings: 3piX(1); /* invalid syntax, feature tag not identifier */
4235- font-feature-settings: ot-3piX; /* 3piX=1 (this feature not defined) */
4236- font-feature-settings: PKRN; /* PKRN=1 enable custom feature */
4261+ font-feature-settings: "dlig" 1; /* dlig=1 enable discretionary ligatures */
4262+ font-feature-settings: "smcp" on; /* smcp=1 enable small caps */
4263+ font-feature-settings: "c2sc"; /* c2sc=1 enable caps to small caps */
4264+ font-feature-settings: "liga" off; /* liga=0 no common ligatures */
4265+ font-feature-settings: "tnum", "hist"; /* tnum=1, hist=1 enabled tabular numbers and historical forms */
4266+ font-feature-settings: "palin" off; /* good idea but invalid tagname, ignored */
4267+ font-feature-settings: "PKRN"; /* PKRN=1 enable custom feature */
42374268</ pre >
42384269
42394270 < p > Authors should generally use ‘< a href ="#propdef-font-variant "> < code
@@ -4246,12 +4277,15 @@ <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
42464277 for other modern font formats that support font features may be added in
42474278 the future.
42484279
4280+ < p class =issue > While the use of quotes distinguishes feature tags as
4281+ defined in an external resource, they still seem a bit clumsy.
4282+
42494283 < div class =example >
42504284 < p > The Japanese text below will be rendered with half-width kana
42514285 characters:</ p >
42524286
42534287 < pre lang =ja >
4254- body { font-feature-settings: hwid; /* Half-width OpenType feature */ }
4288+ body { font-feature-settings: " hwid" ; /* Half-width OpenType feature */ }
42554289
42564290<p> 毎日< a href ="http://images.google.com/images?q=%E3%82%AB%E3%83%AC%E3%83%BC " style ="text-decoration: none; "> カレー</ a > 食べてるのに、飽きない</p>
42574291</ pre >
@@ -4445,7 +4479,7 @@ <h2 id=rendering-considerations><span class=secno>7 </span>Resolving font
44454479 font-family: BodyText;
44464480 src: local("HiraMaruPro-W4");
44474481 font-variant: proportional-width;
4448- font-feature-settings: ital; /* Latin italics within CJK text feature */
4482+ font-feature-settings: " ital" ; /* Latin italics within CJK text feature */
44494483}
44504484
44514485body { font-family: BodyText, serif; }
@@ -4474,7 +4508,7 @@ <h2 id=rendering-considerations><span class=secno>7 </span>Resolving font
44744508 < p > Adding an additional style rule with the @font-face above:</ p >
44754509
44764510 < pre > body { font-family: main, Helvetica; }
4477- span { font-feature-settings: dlig; }
4511+ span { font-feature-settings: " dlig" ; }
44784512span.special { font-variant-ligatures: no-additional-ligatures; }
44794513</ pre >
44804514
@@ -4681,7 +4715,8 @@ <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
46814715 Lunde and Eric Muller provided valuable feedback on CJK OpenType features
46824716 and Unicode variation selectors. The idea for supporting font features by
46834717 using font-variant subproperties originated with Håkon Wium Lie, Adam
4684- Twardoch and Tal Leming.
4718+ Twardoch and Tal Leming. Thanks also to House Industries for allowing the
4719+ use of Ed Interlock in the discretionary ligatures example.
46854720
46864721 < p > A special thanks to Robert Bringhurst for the sublime mind expansion
46874722 that is < em > The Elements of Typographic Style</ em > .
@@ -4933,8 +4968,8 @@ <h2 class=no-num id=index>Index</h2>
49334968 href ="#ltfeature-value-namegt "
49344969 title ="<feature-value-name> "> < strong > 6.9</ strong > </ a >
49354970
4936- < li > < var > <featuretag ></ var > , < a href ="#ltfeaturetaggt "
4937- title ="<featuretag > "> < strong > 6.12</ strong > </ a >
4971+ < li > < var > <featuretagvalue ></ var > , < a href ="#ltfeaturetagvaluegt "
4972+ title ="<featuretagvalue > "> < strong > 6.12</ strong > </ a >
49384973
49394974 < li > <font-description>
49404975 < ul >
@@ -5034,11 +5069,6 @@ <h2 class=no-num id=index>Index</h2>
50345069 < li > contextual, < a href ="#contextual "
50355070 title =contextual > < strong > 6.8</ strong > </ a >
50365071
5037- < li > contextual-swash(<feature-value-name>), < a
5038- href ="#contextual-swashltfeature-value-namegt "
5039- title ="contextual-swash(<feature-value-name>) "> < strong > 6.8</ strong > </ a >
5040-
5041-
50425072 < li > cursive, definition of, < a href ="#cursive0 " title ="cursive, definition
50435073 of "> < strong > #</ strong > </ a >
50445074
@@ -5276,7 +5306,7 @@ <h2 class=no-num id=property-index>Property index</h2>
52765306 < td > < a class =property
52775307 href ="#propdef-font-feature-settings "> font-feature-settings</ a >
52785308
5279- < td > normal | [ <featuretag >]+
5309+ < td > normal | <featuretagvalue> [, <featuretagvalue >]*
52805310
52815311 < td > normal
52825312
@@ -5406,12 +5436,11 @@ <h2 class=no-num id=property-index>Property index</h2>
54065436 <contextual-alt-values> || stylistic[(<integer>)]? ||
54075437 historical-forms || styleset(<integer> [,<integer>]*) ||
54085438 character-variant(<integer> [,<integer>]*) ||
5409- swash[(<integer>)]? || contextual-swash[(<integer>)]? ||
5410- ornament[(<integer>)]? || annotation[(<integer>)]? || ruby
5411- || <caps-value> || <numeric-figure-values> ||
5412- <numeric-spacing-values> || <numeric-fraction-values> ||
5413- slashed-zero || <east-asian-variant-values> ||
5414- <east-asian-width-values> ]
5439+ swash[(<integer>)]? || ornament[(<integer>)]? ||
5440+ annotation[(<integer>)]? || ruby || <caps-value> ||
5441+ <numeric-figure-values> || <numeric-spacing-values> ||
5442+ <numeric-fraction-values> || slashed-zero ||
5443+ <east-asian-variant-values> || <east-asian-width-values> ]
54155444
54165445 < td > normal
54175446
@@ -5432,7 +5461,6 @@ <h2 class=no-num id=property-index>Property index</h2>
54325461 styleset(<feature-value-name> [, <feature-value-name>]*) ||
54335462 character-variant(<feature-value-name>
54345463 [,<feature-value-name>]*) || swash(<feature-value-name>) ||
5435- contextual-swash(<feature-value-name>) ||
54365464 ornament(<feature-value-name>) ||
54375465 annotation(<feature-value-name>) || ruby ]
54385466
0 commit comments