Skip to content

Commit 9be06e2

Browse files
author
John Daggett
committed
tighten font feature values rule parsing and add issue for default features
1 parent 3469c9c commit 9be06e2

1 file changed

Lines changed: 32 additions & 17 deletions

File tree

css3-fonts/Fonts.html

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@
120120

121121
<h1>CSS Fonts Module Level 3</h1>
122122

123-
<h2 class="no-num no-toc" id=editors-draft-6-july-2012>Editor's Draft 6
123+
<h2 class="no-num no-toc" id=editors-draft-28-july-2012>Editor's Draft 28
124124
July 2012</h2>
125125

126126
<dl id=authors>
127127
<dt>This version:
128128

129129
<dd><a
130130
href="http://dev.w3.org/csswg/css3-fonts/">http://dev.w3.org/csswg/css3-fonts/</a>
131-
<!-- <dd><a href="http://www.w3.org/TR/2012/ED-css3-fonts-20120706/">http://www.w3.org/TR/2012/ED-css3-fonts-20120706/</a> -->
131+
<!-- <dd><a href="http://www.w3.org/TR/2012/ED-css3-fonts-20120728/">http://www.w3.org/TR/2012/ED-css3-fonts-20120728/</a> -->
132132

133133

134134
<dt>Latest version:
@@ -4027,13 +4027,18 @@ <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
40274027
class=prod><dfn id=ltfeature-indexgt><var>&lt;feature-index&gt;</var></dfn> = an integer value greater than 0 specific to a given font or set of fonts</pre>
40284028

40294029
<p>These @font-feature-values rules can appear anywhere within a stylesheet
4030-
and are exposed bidirectionally across @import boundaries. If multiple
4031-
@font-feature-values rules are defined for a given family, the resulting
4032-
values defined are the union of these rules. This allows a set of
4033-
named-values to be defined for a given font family globally for a site and
4034-
specific additions made per-page. If the same &lt;feature-value-name&gt;
4035-
is defined mulitple times for a given font-variant value, the last defined
4036-
value is used.
4030+
and are exposed bidirectionally across @import boundaries. Within each
4031+
font feature values declaration, syntax errors such as unknown property
4032+
value names, invalid identifiers or values result in the declaration being
4033+
dropped, similar to the way syntax errors in style declarations are
4034+
handled.
4035+
4036+
<p>If multiple @font-feature-values rules are defined for a given family,
4037+
the resulting values defined are the union of these rules. This allows a
4038+
set of named-values to be defined for a given font family globally for a
4039+
site and specific additions made per-page. If the same
4040+
&lt;feature-value-name&gt; is defined mulitple times for a given
4041+
font-variant value, the last defined value is used.
40374042

40384043
<pre>
40394044
site.css:
@@ -4057,9 +4062,10 @@ <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
40574062

40584063
<p>Only named font families are allowed for &lt;font-family&gt;, rules that
40594064
include generic or system fonts in the list of font families are
4060-
considered syntax errors and ignored. However, if a user agent defines a
4061-
generic font to be a specific named font (e.g. Helvetica), the settings
4062-
associated with that family name will be used.
4065+
considered syntax errors and the contents of the rules are ignored.
4066+
However, if a user agent defines a generic font to be a specific named
4067+
font (e.g. Helvetica), the settings associated with that family name will
4068+
be used.
40634069

40644070
<p>For &lt;font-variant-property-value>, only font specific property value
40654071
names supported by the ‘<a href="#propdef-font-variant"><code
@@ -4099,7 +4105,8 @@ <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
40994105
<p>For the styleset property value, multiple values indicate the style sets
41004106
to be enabled. Values between 1 and 20 enable OpenType features ‘<code
41014107
class=css>ss01</code>’ through ‘<code class=css>ss20</code>’. For
4102-
OpenType fonts, values greater than 20 are ignored.
4108+
OpenType fonts, values greater than 20 or 0 are ignored but do not
4109+
generate a syntax error when parsed.
41034110

41044111
<pre>@font-feature-values Mars Serif {
41054112
@styleset alt-g 1, /* implies ss01 = 1 */
@@ -4117,10 +4124,11 @@ <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
41174124
<p>For character-variant, a single value between 1 and 99 indicates the
41184125
enabling of OpenType feature ‘<code class=css>cv01</code>’ through
41194126
<code class=css>cv99</code>’. For OpenType fonts, values greater than
4120-
99 are ignored. When two values are listed, the first value indicates the
4121-
feature used and the second the value passed for that feature. When two
4122-
value names imply different settings for the same underlying feature the
4123-
last setting is used.
4127+
99 or 0 are ignored but do not generate a syntax error when parsed. When
4128+
two values are listed, the first value indicates the feature used and the
4129+
second the value passed for that feature. When two value names imply
4130+
different settings for the same underlying feature the last setting is
4131+
used.
41244132

41254133
<pre>@font-feature-values MM Greek {
41264134
@character-variant alpha-2 1 2; /* implies cv01 = 2 */
@@ -4659,6 +4667,13 @@ <h2 id=font-feature-resolution><span class=secno>7 </span>Font feature
46594667
href="http://www.microsoft.com/typography/otfntdev/devanot/features.aspx">Devanagari</a>
46604668
additional features are required.
46614669

4670+
<p class=issue>Concern has been expressed that requiring default features
4671+
to be enabled by default will result in text rendering performance
4672+
degradation. One proposed alternative is to add a new default ‘<code
4673+
class=property>auto</code>’ value for font-variant and allow user agents
4674+
to determine whether to enable default features or not when that value is
4675+
used.
4676+
46624677
<p>General and font specific font feature property settings are resolved in
46634678
the order below, in ascending precedence order. This ordering is used to
46644679
construct a combined list of font features that affect a given text run.

0 commit comments

Comments
 (0)