- From: John Daggett via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 04 Mar 2011 08:34:49 +0000
- To: public-css-commits@w3.org
Update of /sources/public/csswg/css3-fonts
In directory hutz:/tmp/cvs-serv5720
Modified Files:
Fonts.html
Log Message:
updated font-feature-settings syntax
Index: Fonts.html
===================================================================
RCS file: /sources/public/csswg/css3-fonts/Fonts.html,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- Fonts.html 3 Mar 2011 13:37:19 -0000 1.41
+++ Fonts.html 4 Mar 2011 08:34:46 -0000 1.42
@@ -111,14 +111,14 @@
<h1>CSS Fonts Module Level 3</h1>
- <h2 class="no-num no-toc" id=editors>Editor's Draft 3 March 2011</h2>
+ <h2 class="no-num no-toc" id=editors>Editor's Draft 4 March 2011</h2>
<dl id=authors>
<dt>This version:
<dd><a
href="http://dev.w3.org/csswg/css3-fonts/">http://dev.w3.org/csswg/css3-fonts/</a>
- <!-- <dd><a href="http://www.w3.org/TR/2011/ED-css3-fonts-20110303">http://www.w3.org/TR/2011/ED-css3-fonts-20110303</a> -->
+ <!-- <dd><a href="http://www.w3.org/TR/2011/ED-css3-fonts-20110304">http://www.w3.org/TR/2011/ED-css3-fonts-20110304</a> -->
<dt>Latest version:
@@ -4191,7 +4191,7 @@
<tr>
<td>Value:
- <td>normal | <string>
+ <td>normal | [<featuretag>]+
<tr>
<td>Initial:
@@ -4223,54 +4223,76 @@
<td>as specified
</table>
- <!-- ...they are not well-suited for use in a general use property. -->
- <p>This property provides low-level control over font features. It is
- intended as a way of providing access to font features that are not widely
- used but are needed for a particular use case. A value of ‘<code
- class=property>normal</code>’ means that no change in rendering occurs
- due to this property while a string value defines a specific set of font
- settings to be used when rendering. A null string is equivalent to
- specifying a value of ‘<code class=property>normal</code>’. This
- property only affects font rendering, its value does not affect font
- selection.
+ <p>This property provides low-level control over OpenType font features. It
+ is intended as a way of providing access to font features that are not
+ widely used but are needed for a particular use case. A value of ‘<code
+ class=property>normal</code>’ means that no change in glyph selection or
+ positioning occurs due to this property.
- <p>The string used is specific to the type of font used. For OpenType
- fonts, the value of ‘<code class=css><string></code>’ is a
- comma-separated list of <feature-name>=<integer> paired
- values, where ‘<code class=css><feature-name></code>’ is the
- case-sensitive name of an OpenType feature defined in <a
+ <p>
+
+ <pre>/* enable small caps and use second swash alternate */
+font-feature-settings: smcp swsh(2);</pre>
+
+ <p>Feature tags are used with the following syntax:
+
+ <pre
+ class=prod><dfn id=ltfeaturetaggt><var><featuretag></var></dfn> = [ot-]ident[( <integer> | on | off )]?</pre>
+
+ <p>The identifier indicates a case-sensitive OpenType feature tag. For it
+ to match an OpenType feature contained in a font, it must follow the
+ syntax rules for tags. OpenType feature tags that are not valid CSS
+ identifiers or conflict with CSS keywords must be prefixed with ‘<code
+ class=property>ot-</code>’. In this case the ‘<code
+ class=property>ot-</code>’ prefex is removed and the remaining portion
+ of the identifier is used to lookup the feature tag in the font. Feature
+ tags need only match a feature tag defined in the font, they are not
+ limited to explicitly registered OpenType features. Fonts defining custom
+ feature tags should follow the <a
+ href="http://www.microsoft.com/typography/otspec/featuretags.htm">tag name
+ rules</a> defined in the OpenType specification <a
href="#OPENTYPE-FEATURES"
- rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a> and
- ‘<code class=css><integer></code>’ is 0 or a positive integer.
- For OpenType features that are boolean in nature, a value of 0 disables
- the feature and a non-zero value enables the feature. Value pairs that
- refer to non-existent features or use values not appropriate for the
- feature are ignored. Whitespace within the string is ignored.
+ rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a>.
+ Feature tags not present in the font are ignored; a user agent must not
+ attempt to synthesize fallback behavior based on these feature tags.
+
+ <p>If present, a value in parentheses indicates an index used for glyph
+ selection. An <integer> value must be 0 or greater. A value of 0
+ indicates that the feature is disabled. For boolean features, a value of 1
+ enables the feature. For non-boolean features, a value of 1 or greater
+ enables the feature and indicates the feature selection index. A value of
+ ‘<code class=property>on</code>’ is synonymous with 1 and ‘<code
+ class=property>off</code>’ is synonymous with 0. If the value in
+ parentheses is omitted, a value of 1 is assumed.
+
+ <pre>
+font-feature-settings: dlig(1); /* dlig=1 enable discretionary ligatures */
+font-feature-settings: smcp(on); /* smcp=1 enable small caps */
+font-feature-settings: ot-c2sc; /* c2sc=1 enable caps to small caps */
+font-feature-settings: liga(off); /* liga=0 no common ligatures */
+font-feature-settings: tnum hist; /* tnum=1, hist=1 enabled tabular numbers and historical forms */
+font-feature-settings: 3piX(1); /* invalid syntax, feature tag not identifier */
+font-feature-settings: ot-3piX; /* 3piX=1 (this feature not defined) */
+font-feature-settings: PKRN; /* PKRN=1 enable custom feature */
+</pre>
<p>Authors should generally use ‘<code class=property><a
href="#propdef-font-variant">font-variant</a></code>’ and its related
subproperties whenever possible and only use this property for special
cases where its use is the only way of accessing a particular infrequently
- used font feature.</p>
- <!--
-
-Substitute epigraphy example below.
-
-Scholars studying Greek coin inscriptions often come across many
-different variations for individual Greek letters found on ancient
-coinage. Using a font containing character variants found in these
-inscriptions, an author can describe precisely the appearance of
-the underlying Greek text without using Unicode private-user codepoints.
+ used font feature.
--->
+ <p>Although specifically defined for OpenType feature tags, feature tags
+ for other modern font formats that support font features may be added in
+ the future.
<div class=example>
<p>The Japanese text below will be rendered with half-width kana
characters:</p>
<pre lang=ja>
-body { font-feature-settings: "hwid=1"; /* Half-width OpenType feature */ }
+body { font-feature-settings: hwid; /* Half-width OpenType feature */ }
<p>毎日<a href="http://images.google.com/images?q=%E3%82%AB%E3%83%AC%E3%83%BC" style="text-decoration: none;">カレー</a>食べてるのに、飽きない</p>
</pre>
@@ -4686,10 +4708,8 @@
<li>Revised font matching algorithm
- <li>Added font-weight-synthetic, font-style-synthetic properties
-
- <li>Added specific requirements and guidelines for dealing with OpenType
- names
+ <li>Added font-weight-synthetic, font-style-synthetic properties</li>
+ <!-- Added specific requirements and guidelines for dealing with OpenType names -->
</ul>
<h2 class=no-num id=acknowledgments>Acknowledgments</h2>
@@ -4989,6 +5009,9 @@
<li><var><feature-index></var>, <a href="#ltfeature-indexgt"
title="<feature-index>"><strong>6.9</strong></a>
+ <li><var><featuretag></var>, <a href="#ltfeaturetaggt"
+ title="<featuretag>"><strong>6.12</strong></a>
+
<li><var><feature-value-list></var>, <a
href="#ltfeature-value-listgt"
title="<feature-value-list>"><strong>6.9</strong></a>
@@ -5294,7 +5317,7 @@
<td><a class=property
href="#propdef-font-feature-settings">font-feature-settings</a>
- <td>normal | <string>
+ <td>normal | [<featuretag>]+
<td>normal
@@ -5448,8 +5471,8 @@
<td>normal | inherit | [ <contextual-alt-values> ||
stylistic(<feature-value-name>) || historical-forms ||
- styleset(<;feature-value-name> [, <feature-value-name>]*)
- || character-variant(<feature-value-name>
+ styleset(<feature-value-name> [, <feature-value-name>]*) ||
+ character-variant(<feature-value-name>
[,<feature-value-name>]*) || swash(<feature-value-name>) ||
contextual-swash(<feature-value-name>) ||
ornament(<feature-value-name>) ||
@@ -5609,18 +5632,8 @@
to do:
-- rework intro to font features
-- describe how font-variant values do *not* apply for system-wide fallback
-- rework syntax of font-feature-settings
-- define on/off as aliases for 1/0 when numeric selectors are used for font-feature-settings
-- wording for superscript/subscript handling
- wording of OpenType family name handling
-- font-stretch matching
- handling combining sequences in the font matching algorithm
- fix-up fi ligature example
-done:
-
-* add character-variant
-
-->
Received on Friday, 4 March 2011 08:34:51 UTC