Skip to content

Commit 27d708f

Browse files
author
John Daggett
committed
[css-fonts] fixups based on font-variant-*, minor comments II (but I'm not hyphenating subproperty dammit)
1 parent 3d5ba93 commit 27d708f

1 file changed

Lines changed: 48 additions & 71 deletions

File tree

css-fonts/Fonts.html

Lines changed: 48 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -4408,11 +4408,22 @@ <h3 id=font-variant-alternates-prop><span class=secno>6.8 </span>Alternates
44084408
font-variant-alternates: swash(flowing); /* use swash alternate #2 */
44094409
}</pre>
44104410

4411-
<p>When a particular value has not been defined for a given family, the
4412-
named value is treated as if the feature had been omitted from the style
4413-
rule. If a given value is outside the range supported by a given font, the
4414-
value is ignored. These values never apply to generic font families, nor
4415-
to families selected as part of system font fallback.
4411+
<p>When a particular <code>&lt;feature-value-name&gt;</code> has not been
4412+
defined for a given family or for a particular feature type, the computed
4413+
value must be the same as if it had been defined. However, property values
4414+
that contain these undefined <code>&lt;feature-value-name&gt;</code>
4415+
identifiers must be ignored when choosing glyphs.
4416+
4417+
<pre>/* these two style rules are effectively the same */
4418+
p { font-variant-alternates: swash(unknown-value); } /* not a defined value, ignored */
4419+
p { font-variant-alternates: normal; }
4420+
</pre>
4421+
4422+
<p>This allows values to be defined and used for a given set of font
4423+
families but ignored if fallback occurs, since the font family name would
4424+
be different. If a given value is outside the range supported by a given
4425+
font, the value is ignored. These values never apply to generic font
4426+
families.
44164427

44174428
<p>Individual values have the following meanings:
44184429

@@ -4541,44 +4552,7 @@ <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
45414552
values specified within a given font's data.
45424553

45434554
<p>In terms of the grammar, this specification defines the following
4544-
productions:</p>
4545-
<!--
4546-
<pre><dfn>supports_rule</dfn>
4547-
: <i>SUPPORTS_SYM</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <i>supports_condition</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <i>group_rule_body</i>
4548-
;
4549-
4550-
<dfn>supports_condition</dfn>
4551-
: <i>supports_negation</i> | <i>supports_conjunction</i> | <i>supports_disjunction</i> |
4552-
<i>supports_condition_in_parens</i>
4553-
;
4554-
4555-
<dfn>supports_condition_in_parens</dfn>
4556-
: ( '(' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <i>supports_condition</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* ')' ) | <i>supports_declaration_condition</i> |
4557-
<i>general_enclosed</i>
4558-
;
4559-
4560-
<dfn>supports_negation</dfn>
4561-
: <a href="http://www.w3.org/TR/css3-mediaqueries/#syntax"><i>NOT</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>supports_condition_in_parens</i>
4562-
;
4563-
4564-
<dfn>supports_conjunction</dfn>
4565-
: <i>supports_condition_in_parens</i> ( <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <a href="http://www.w3.org/TR/css3-mediaqueries/#syntax"><i>AND</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>supports_condition_in_parens</i> )+
4566-
;
4567-
4568-
<dfn>supports_disjunction</dfn>
4569-
: <i>supports_condition_in_parens</i> ( <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>OR</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>supports_condition_in_parens</i> )+
4570-
;
4571-
4572-
<dfn>supports_declaration_condition</dfn>
4573-
: '(' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>declaration</i></a> ')'
4574-
;
4575-
4576-
<dfn>general_enclosed</dfn>
4577-
: ( <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>FUNCTION</i></a> | '(' ) ( <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>any</i></a> | <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>unused</i></a> )* ')'
4578-
;
4579-
</pre>
4580-
4581-
-->
4555+
productions:
45824556

45834557
<pre><dfn id=fontfeaturevaluesrule>font_feature_values_rule</dfn>
45844558
: <a href="#fontfeaturevaluessym"><i>FONT_FEATURE_VALUES_SYM</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#fontfamilynamelist"><i>font_family_name_list</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
@@ -4952,20 +4926,21 @@ <h3 id=font-variant-east-asian-prop><span class=secno>6.10 </span>East
49524926

49534927
<dd>Enables rendering of simplified forms (OpenType feature: <span
49544928
class=tag>smpl</span>).
4955-
<p>The ‘<a href="#simplified"><code
4956-
class=property>simplified</code></a>’ and ‘<a
4957-
href="#traditional"><code class=property>traditional</code></a>
4958-
values allow control over the glyph forms for characters which have been
4959-
simplified over time but for which the older, traditional form is still
4960-
used in some contexts. The exact set of characters and glyph forms will
4961-
vary to some degree by context for which a given font was designed.</p>
49624929

49634930
<dt><dfn id=traditional>traditional</dfn>
49644931

49654932
<dd>Enables rendering of traditional forms (OpenType feature: <span
49664933
class=tag>trad</span>).
49674934
</dl>
49684935

4936+
<p>The ‘<a href="#simplified"><code
4937+
class=property>simplified</code></a>’ and ‘<a
4938+
href="#traditional"><code class=property>traditional</code></a>’ values
4939+
allow control over the glyph forms for characters which have been
4940+
simplified over time but for which the older, traditional form is still
4941+
used in some contexts. The exact set of characters and glyph forms will
4942+
vary to some degree by context for which a given font was designed.
4943+
49694944
<div class=featex><img alt="tradtional form example" src=trad.png></div>
49704945

49714946
<dl>
@@ -5090,10 +5065,11 @@ <h3 id=font-variant-prop><span class=secno>6.11 </span>Overall shorthand
50905065
<td>see individual properties
50915066
</table>
50925067

5093-
<p>The value <dfn id=font-variant-normal-value
5094-
title="normal!!font-variant"><code
5095-
class=property>normal</code></dfn> resets all other font feature
5096-
properties to their inital value. The <dfn id=font-variant-none-value
5068+
<p>The ‘<code class=property>font-variant</code>’ property is a
5069+
shorthand for all font-variant subproperties. The value <dfn
5070+
id=font-variant-normal-value title="normal!!font-variant"><code
5071+
class=property>normal</code></dfn> resets all subproperties of
5072+
font-variant to their inital value. The <dfn id=font-variant-none-value
50975073
title="none!!font-variant"><code class=property>none</code></dfn>
50985074
value sets ‘<a href="#propdef-font-variant-ligatures"><code
50995075
class=property>font-variant-ligatures</code></a>’ to ‘<code
@@ -5165,17 +5141,23 @@ <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
51655141

51665142
<p>This property provides low-level control over OpenType font features. It
51675143
is intended as a way of providing access to font features that are not
5168-
widely used but are needed for a particular use case. A value of <dfn
5169-
id=font-feature-settings-normal-value
5170-
title="normal!!font-feature-settings"><code
5171-
class=property>normal</code></dfn> means that no change in glyph
5172-
selection or positioning occurs due to this property.
5144+
widely used but are needed for a particular use case.
51735145

5174-
<p>
5146+
<p>Authors should generally use <a href="#propdef-font-variant"
5147+
title="font-variant!!property"><code
5148+
class=property>font-variant</code></a> and its related subproperties
5149+
whenever possible and only use this property for special cases where its
5150+
use is the only way of accessing a particular infrequently used font
5151+
feature.
51755152

51765153
<pre>/* enable small caps and use second swash alternate */
51775154
font-feature-settings: "smcp", "swsh" 2;</pre>
51785155

5156+
<p>A value of <dfn id=font-feature-settings-normal-value
5157+
title="normal!!font-feature-settings"><code
5158+
class=property>normal</code></dfn> means that no change in glyph
5159+
selection or positioning occurs due to this property.
5160+
51795161
<p>Feature tag values have the following syntax:
51805162

51815163
<pre
@@ -5185,10 +5167,9 @@ <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
51855167
specified in the OpenType specification, feature tags contain four ASCII
51865168
characters. Tag strings longer or shorter than four characters, or
51875169
containing characters outside the U+20–7E codepoint range are invalid.
5188-
User agents must not use a feature tag created by truncating or padding
5189-
the string to four characters. Feature tags need only match a feature tag
5190-
defined in the font, they are not limited to explicitly registered
5191-
OpenType features. Fonts defining custom feature tags should follow the <a
5170+
Feature tags need only match a feature tag defined in the font, so they
5171+
are not limited to explicitly registered OpenType features. Fonts defining
5172+
custom feature tags should follow the <a
51925173
href="http://www.microsoft.com/typography/otspec/featuretags.htm">tag name
51935174
rules</a> defined in the OpenType specification <a
51945175
href="#OPENTYPE-FEATURES"
@@ -5233,13 +5214,6 @@ <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
52335214
the exact behavior will depend upon the way the font is designed
52345215
(specifically, which type of lookup is used to define the feature).
52355216

5236-
<p>Authors should generally use <a href="#propdef-font-variant"
5237-
title="font-variant!!property"><code
5238-
class=property>font-variant</code></a> and its related subproperties
5239-
whenever possible and only use this property for special cases where its
5240-
use is the only way of accessing a particular infrequently used font
5241-
feature.
5242-
52435217
<p>Although specifically defined for OpenType feature tags, feature tags
52445218
for other modern font formats that support font features may be added in
52455219
the future. Where possible, features defined for other font formats should
@@ -5344,6 +5318,9 @@ <h3 id=font-language-override-prop><span class=secno>6.13 </span>Font
53445318
of the language system implied by the language of the element
53455319
</dl>
53465320

5321+
<p>Use of invalid OpenType language system tags must not generate a parse
5322+
error but must be ignored when doing glyph selection and placement.
5323+
53475324
<div class=example>
53485325
<p>The <a href="http://www.un.org/en/documents/udhr/index.shtml">Universal
53495326
Declaration of Human Rights</a> has been translated into a wide variety

0 commit comments

Comments
 (0)