|
111 | 111 |
|
112 | 112 | <h1>CSS Fonts Module Level 3</h1> |
113 | 113 |
|
114 | | - <h2 class="no-num no-toc" id=editors>Editor's Draft 3 March 2011</h2> |
| 114 | + <h2 class="no-num no-toc" id=editors>Editor's Draft 4 March 2011</h2> |
115 | 115 |
|
116 | 116 | <dl id=authors> |
117 | 117 | <dt>This version: |
118 | 118 |
|
119 | 119 | <dd><a |
120 | 120 | href="http://dev.w3.org/csswg/css3-fonts/">http://dev.w3.org/csswg/css3-fonts/</a> |
121 | | - <!-- <dd><a href="http://www.w3.org/TR/2011/ED-css3-fonts-20110303">http://www.w3.org/TR/2011/ED-css3-fonts-20110303</a> --> |
| 121 | + <!-- <dd><a href="http://www.w3.org/TR/2011/ED-css3-fonts-20110304">http://www.w3.org/TR/2011/ED-css3-fonts-20110304</a> --> |
122 | 122 |
|
123 | 123 |
|
124 | 124 | <dt>Latest version: |
@@ -4191,7 +4191,7 @@ <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level |
4191 | 4191 | <tr> |
4192 | 4192 | <td>Value: |
4193 | 4193 |
|
4194 | | - <td>normal | <string> |
| 4194 | + <td>normal | [<featuretag>]+ |
4195 | 4195 |
|
4196 | 4196 | <tr> |
4197 | 4197 |
FBC8
<td>Initial: |
@@ -4223,54 +4223,76 @@ <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level |
4223 | 4223 |
|
4224 | 4224 | <td>as specified |
4225 | 4225 | </table> |
4226 | | - <!-- ...they are not well-suited for use in a general use property. --> |
4227 | | - |
4228 | | - <p>This property provides low-level control over font features. It is |
4229 | | - intended as a way of providing access to font features that are not widely |
4230 | | - used but are needed for a particular use case. A value of ‘<code |
4231 | | - class=property>normal</code>’ means that no change in rendering occurs |
4232 | | - due to this property while a string value defines a specific set of font |
4233 | | - settings to be used when rendering. A null string is equivalent to |
4234 | | - specifying a value of ‘<code class=property>normal</code>’. This |
4235 | | - property only affects font rendering, its value does not affect font |
4236 | | - selection. |
4237 | | - |
4238 | | - <p>The string used is specific to the type of font used. For OpenType |
4239 | | - fonts, the value of ‘<code class=css><string></code>’ is a |
4240 | | - comma-separated list of <feature-name>=<integer> paired |
4241 | | - values, where ‘<code class=css><feature-name></code>’ is the |
4242 | | - case-sensitive name of an OpenType feature defined in <a |
| 4226 | + |
| 4227 | + <p>This property provides low-level control over OpenType font features. It |
| 4228 | + is intended as a way of providing access to font features that are not |
| 4229 | + widely used but are needed for a particular use case. A value of ‘<code |
| 4230 | + class=property>normal</code>’ means that no change in glyph selection or |
| 4231 | + positioning occurs due to this property. |
| 4232 | + |
| 4233 | + <p> |
| 4234 | + |
| 4235 | + <pre>/* enable small caps and use second swash alternate */ |
| 4236 | +font-feature-settings: smcp swsh(2);</pre> |
| 4237 | + |
| 4238 | + <p>Feature tags are used with the following syntax: |
| 4239 | + |
| 4240 | + <pre |
| 4241 | + class=prod><dfn id=ltfeaturetaggt><var><featuretag></var></dfn> = [ot-]ident[( <integer> | on | off )]?</pre> |
| 4242 | + |
| 4243 | + <p>The identifier indicates a case-sensitive OpenType feature tag. For it |
| 4244 | + to match an OpenType feature contained in a font, it must follow the |
| 4245 | + syntax rules for tags. OpenType feature tags that are not valid CSS |
| 4246 | +<
FF8
div class="diff-text-inner"> identifiers or conflict with CSS keywords must be prefixed with ‘<code |
| 4247 | + class=property>ot-</code>’. In this case the ‘<code |
| 4248 | + class=property>ot-</code>’ prefex is removed and the remaining portion |
| 4249 | + of the identifier is used to lookup the feature tag in the font. Feature |
| 4250 | + tags need only match a feature tag defined in the font, they are not |
| 4251 | + limited to explicitly registered OpenType features. Fonts defining custom |
| 4252 | + feature tags should follow the <a |
| 4253 | + href="http://www.microsoft.com/typography/otspec/featuretags.htm">tag name |
| 4254 | + rules</a> defined in the OpenType specification <a |
4243 | 4255 | href="#OPENTYPE-FEATURES" |
4244 | | - rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a> and |
4245 | | - ‘<code class=css><integer></code>’ is 0 or a positive integer. |
4246 | | - For OpenType features that are boolean in nature, a value of 0 disables |
4247 | | - the feature and a non-zero value enables the feature. Value pairs that |
4248 | | - refer to non-existent features or use values not appropriate for the |
4249 | | - feature are ignored. Whitespace within the string is ignored. |
| 4256 | + rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a>. |
| 4257 | + Feature tags not present in the font are ignored; a user agent must not |
| 4258 | + attempt to synthesize fallback behavior based on these feature tags. |
| 4259 | + |
| 4260 | + <p>If present, a value in parentheses indicates an index used for glyph |
| 4261 | + selection. An <integer> value must be 0 or greater. A value of 0 |
| 4262 | + indicates that the feature is disabled. For boolean features, a value of 1 |
| 4263 | + enables the feature. For non-boolean features, a value of 1 or greater |
| 4264 | + enables the feature and indicates the feature selection index. A value of |
| 4265 | + ‘<code class=property>on</code>’ is synonymous with 1 and ‘<code |
| 4266 | + class=property>off</code>’ is synonymous with 0. If the value in |
| 4267 | + parentheses is omitted, a value of 1 is assumed. |
| 4268 | + |
| 4269 | + <pre> |
| 4270 | +font-feature-settings: dlig(1); /* dlig=1 enable discretionary ligatures */ |
| 4271 | +font-feature-settings: smcp(on); /* smcp=1 enable small caps */ |
| 4272 | +font-feature-settings: ot-c2sc; /* c2sc=1 enable caps to small caps */ |
| 4273 | +font-feature-settings: liga(off); /* liga=0 no common ligatures */ |
| 4274 | +font-feature-settings: tnum hist; /* tnum=1, hist=1 enabled tabular numbers and historical forms */ |
| 4275 | +font-feature-settings: 3piX(1); /* invalid syntax, feature tag not identifier */ |
| 4276 | +font-feature-settings: ot-3piX; /* 3piX=1 (this feature not defined) */ |
| 4277 | +font-feature-settings: PKRN; /* PKRN=1 enable custom feature */ |
| 4278 | +</pre> |
4250 | 4279 |
|
4251 | 4280 | <p>Authors should generally use ‘<code class=property><a |
4252 | 4281 | href="#propdef-font-variant">font-variant</a></code>’ and its related |
4253 | 4282 | subproperties whenever possible and only use this property for special |
4254 | 4283 | cases where its use is the only way of accessing a particular infrequently |
4255 | | - used font feature.</p> |
4256 | | - <!-- |
| 4284 | + used font feature. |
4257 | 4285 |
|
4258 | | -Substitute epigraphy example below. |
4259 | | -
|
4260 | | -Scholars studying Greek coin inscriptions often come across many |
4261 | | -different variations for individual Greek letters found on ancient |
4262 | | -coinage. Using a font containing character variants found in these |
4263 | | -inscriptions, an author can describe precisely the appearance of |
4264 | | -the underlying Greek text without using Unicode private-user codepoints. |
4265 | | -
|
4266 | | ---> |
| 4286 | + <p>Although specifically defined for OpenType feature tags, feature tags |
| 4287 | + for other modern font formats that support font features may be added in |
| 4288 | + the future. |
4267 | 4289 |
|
4268 | 4290 | <div class=example> |
4269 | 4291 | <p>The Japanese text below will be rendered with half-width kana |
4270 | 4292 | characters:</p> |
4271 | 4293 |
|
4272 | 4294 | <pre lang=ja> |
4273 | | -body { font-feature-settings: "hwid=1"; /* Half-width OpenType feature */ } |
| 4295 | +body { font-feature-settings: hwid; /* Half-width OpenType feature */ } |
4274 | 4296 |
|
4275 | 4297 | <p>毎日<a href="http://images.google.com/images?q=%E3%82%AB%E3%83%AC%E3%83%BC" style="text-decoration: none;">カレー</a>食べてるのに、飽きない</p> |
4276 | 4298 | </pre> |
@@ -4686,10 +4708,8 @@ <h3 class=no-num id=recent-changes> Changes from the <a |
4686 | 4708 |
|
4687 | 4709 | <li>Revised font matching algorithm |
4688 | 4710 |
|
4689 | | - <li>Added font-weight-synthetic, font-style-synthetic properties |
4690 | | - |
4691 | | - <li>Added specific requirements and guidelines for dealing with OpenType |
4692 | | - names |
| 4711 | + <li>Added font-weight-synthetic, font-style-synthetic properties</li> |
| 4712 | + <!-- Added specific requirements and guidelines for dealing with OpenType names --> |
4693 | 4713 | </ul> |
4694 | 4714 |
|
4695 | 4715 | <h2 class=no-num id=acknowledgments>Acknowledgments</h2> |
@@ -4989,6 +5009,9 @@ <h2 class=no-num id=index>Index</h2> |
4989 | 5009 | <li><var><feature-index></var>, <a href="#ltfeature-indexgt" |
4990 | 5010 | title="<feature-index>"><strong>6.9</strong></a> |
4991 | 5011 |
|
| 5012 | + <li><var><featuretag></var>, <a href="#ltfeaturetaggt" |
| 5013 | + title="<featuretag>"><strong>6.12</strong></a> |
| 5014 | + |
4992 | 5015 | <li><var><feature-value-list></var>, <a |
4993 | 5016 | href="#ltfeature-value-listgt" |
4994 | 5017 | title="<feature-value-list>"><strong>6.9</strong></a> |
@@ -5294,7 +5317,7 @@ <h2 class=no-num id=property-index>Property index</h2> |
5294 | 5317 | <td><a class=property |
5295 | 5318 | href="#propdef-font-feature-settings">font-feature-settings</a> |
5296 | 5319 |
|
5297 | | - <td>normal | <string> |
| 5320 | + <td>normal | [<featuretag>]+ |
5298 | 5321 |
|
5299 | 5322 | <td>normal |
5300 | 5323 |
|
@@ -5448,8 +5471,8 @@ <h2 class=no-num id=property-index>Property index</h2> |
5448 | 5471 |
|
5449 | 5472 | <td>normal | inherit | [ <contextual-alt-values> || |
5450 | 5473 | stylistic(<feature-value-name>) || historical-forms || |
5451 | | - styleset(<;feature-value-name> [, <feature-value-name>]*) |
5452 | | - || character-variant(<feature-value-name> |
| 5474 | + styleset(<feature-value-name> [, <feature-value-name>]*) || |
| 5475 | + character-variant(<feature-value-name> |
5453 | 5476 | [,<feature-value-name>]*) || swash(<feature-value-name>) || |
5454 | 5477 | contextual-swash(<feature-value-name>) || |
5455 | 5478 | ornament(<feature-value-name>) || |
@@ -5609,18 +5632,8 @@ <h2 class=no-num id=property-index>Property index</h2> |
5609 | 5632 |
|
5610 | 5633 | to do: |
5611 | 5634 |
|
5612 | | -- rework intro to font features |
5613 | | -- describe how font-variant values do *not* apply for system-wide fallback |
5614 | | -- rework syntax of font-feature-settings |
5615 | | -- define on/off as aliases for 1/0 when numeric selectors are used for font-feature-settings |
5616 | | -- wording for superscript/subscript handling |
5617 | 5635 | - wordi
5B77
ng of OpenType family name handling |
5618 | | -- font-stretch matching |
5619 | 5636 | - handling combining sequences in the font matching algorithm |
5620 | 5637 | - fix-up fi ligature example |
5621 | 5638 |
|
5622 | | -done: |
5623 | | -
|
5624 | | -* add character-variant |
5625 | | -
|
5626 | 5639 | --> |
0 commit comments