Skip to content

Commit 4c2a00e

Browse files
authored
[css-fonts-4] Clarify range constraints on descriptor values in <font-feature-value-type> (#13324)
* [css-fonts-4] Rename <feature-*> to <font-feature-*> * [css-fonts-4] Clarify range constraints on descriptor values in <font-feature-value-type>
1 parent b23bac6 commit 4c2a00e

File tree

1 file changed

+37
-27
lines changed

1 file changed

+37
-27
lines changed

css-fonts-4/Overview.bs

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5814,13 +5814,13 @@ Alternates and swashes: the 'font-variant-alternates' property</h3>
58145814

58155815
<pre class="propdef">
58165816
Name: font-variant-alternates
5817-
Value: normal | [ stylistic(<<feature-value-name>>) ||
5817+
Value: normal | [ stylistic(<<font-feature-value-name>>) ||
58185818
historical-forms ||
5819-
styleset(<<feature-value-name>>#) ||
5820-
character-variant(<<feature-value-name>>#) ||
5821-
swash(<<feature-value-name>>) ||
5822-
ornaments(<<feature-value-name>>) ||
5823-
annotation(<<feature-value-name>>) ]
5819+
styleset(<<font-feature-value-name>>#) ||
5820+
character-variant(<<font-feature-value-name>>#) ||
5821+
swash(<<font-feature-value-name>>) ||
5822+
ornaments(<<font-feature-value-name>>) ||
5823+
annotation(<<font-feature-value-name>>) ]
58245824
Initial: normal
58255825
Applies to: all elements and text
58265826
Inherited: yes
@@ -5856,8 +5856,8 @@ Alternates and swashes: the 'font-variant-alternates' property</h3>
58565856
parsing/font-variant-alternates-valid.html
58575857
</wpt>
58585858

5859-
<pre class="prod"><dfn id="feature-index-value">&lt;feature-index&gt;</dfn> = <<integer [0,∞]>></pre>
5860-
<pre class="prod"><dfn id="feature-value-name-value">&lt;feature-value-name&gt;</dfn> = <<ident>></pre>
5859+
<pre class="prod"><dfn id="font-feature-index-value">&lt;font-feature-index&gt;</dfn> = <<integer>></pre>
5860+
<pre class="prod"><dfn id="font-feature-value-name-value">&lt;font-feature-value-name&gt;</dfn> = <<ident>></pre>
58615861

58625862
For any given character, fonts can provide a variety of alternate
58635863
glyphs in addition to the default glyph for that character. This
@@ -5871,8 +5871,8 @@ Alternates and swashes: the 'font-variant-alternates' property</h3>
58715871
of these alternates is font-specific, the
58725872
''@font-feature-values'' rule is used to define values for a
58735873
specific font family or set of families that associate a font-specific
5874-
numeric <<feature-index>> with a custom
5875-
<<feature-value-name>>, which is then used in this
5874+
numeric <<font-feature-index>> with a custom
5875+
<<font-feature-value-name>>, which is then used in this
58765876
property to select specific alternates:
58775877

58785878
<pre class=example id="ex-noble-script">
@@ -5884,10 +5884,10 @@ Alternates and swashes: the 'font-variant-alternates' property</h3>
58845884
}
58855885
</pre>
58865886

5887-
When a particular <<feature-value-name>> has not
5887+
When a particular <<font-feature-value-name>> has not
58885888
been defined for a given family or for a particular feature type, the
58895889
computed value must be the same as if it had been defined. However,
5890-
property values that contain these undefined <<feature-value-name>>
5890+
property values that contain these undefined <<font-feature-value-name>>
58915891
identifiers must be ignored when choosing glyphs.
58925892

58935893
<pre class=example id="ex-effectively-same">
@@ -5917,37 +5917,37 @@ Alternates and swashes: the 'font-variant-alternates' property</h3>
59175917
</div>
59185918
</dd>
59195919

5920-
<dt><dfn id="stylistic" title="stylistic">stylistic(<<feature-value-name>>)</dfn>
5921-
<dd>Enables display of stylistic alternates ([=font specific=], OpenType feature: <span class="tag">salt <<feature-index>></span>).
5920+
<dt><dfn id="stylistic" title="stylistic">stylistic(<<font-feature-value-name>>)</dfn>
5921+
<dd>Enables display of stylistic alternates ([=font specific=], OpenType feature: <span class="tag">salt <<font-feature-index>></span>).
59225922

59235923
<div class="featex">
59245924
<img alt="stylistic alternate example" src="images/salt.png" width="300" height="58">
59255925
</div>
59265926
</dd>
59275927

5928-
<dt><dfn id="styleset" title="styleset">styleset(<<feature-value-name>>#)</dfn>
5929-
<dd>Enables display with stylistic sets ([=font specific=], OpenType feature: <span class="tag">ss<<feature-index>></span>
5928+
<dt><dfn id="styleset" title="styleset">styleset(<<font-feature-value-name>>#)</dfn>
5929+
<dd>Enables display with stylistic sets ([=font specific=], OpenType feature: <span class="tag">ss<<font-feature-index>></span>
59305930
OpenType currently defines <span class="tag">ss01</span> through <span class="tag">ss20</span>).
59315931

59325932
<div class="featex">
59335933
<img alt="styleset example" src="images/ssnn.png" width="700" height="76">
59345934
</div>
59355935
</dd>
59365936

5937-
<dt><dfn id="character-variant" title="character-variant">character-variant(<<feature-value-name>>#)</dfn>
5938-
<dd>Enables display of specific character variants ([=font specific=], OpenType feature: <span class="tag">cv<<feature-index>></span>
5937+
<dt><dfn id="character-variant" title="character-variant">character-variant(<<font-feature-value-name>>#)</dfn>
5938+
<dd>Enables display of specific character variants ([=font specific=], OpenType feature: <span class="tag">cv<<font-feature-index>></span>
59395939
OpenType currently defines <span class="tag">cv01</span> through <span class="tag">cv99</span>).</dd>
59405940

5941-
<dt><dfn id="swash" title="swash">swash(<<feature-value-name>>)</dfn>
5942-
<dd>Enables display of swash glyphs ([=font specific=], OpenType feature: <span class="tag">swsh <<feature-index>>, cswh <<feature-index>></span>).
5941+
<dt><dfn id="swash" title="swash">swash(<<font-feature-value-name>>)</dfn>
5942+
<dd>Enables display of swash glyphs ([=font specific=], OpenType feature: <span class="tag">swsh <<font-feature-index>>, cswh <<font-feature-index>></span>).
59435943

59445944
<div class="featex">
59455945
<img alt="swash example" src="images/swsh.png" width="380" height="64">
59465946
</div>
59475947
</dd>
59485948

5949-
<dt><dfn id="ornaments" title="ornaments">ornaments(<<feature-value-name>>)</dfn>
5950-
<dd>Enables replacement of default glyphs with ornaments, if provided in the font ([=font specific=], OpenType feature: <span class="tag">ornm <<feature-index>></span>).
5949+
<dt><dfn id="ornaments" title="ornaments">ornaments(<<font-feature-value-name>>)</dfn>
5950+
<dd>Enables replacement of default glyphs with ornaments, if provided in the font ([=font specific=], OpenType feature: <span class="tag">ornm <<font-feature-index>></span>).
59515951
Some fonts may offer ornament glyphs as alternates for a wide collection of characters; however, displaying arbitrary
59525952
characters (e.g., alphanumerics) as ornaments is poor practice as it distorts the semantics of the data. Font designers
59535953
are encouraged to encode all ornaments (except those explicitly encoded in the Unicode Dingbats blocks, etc.) as
@@ -5958,8 +5958,8 @@ Alternates and swashes: the 'font-variant-alternates' property</h3>
59585958
</div>
59595959
</dd>
59605960

5961-
<dt><dfn id="annotation" title="annotation">annotation(<<feature-value-name>>)</dfn>
5962-
<dd>Enables display of alternate annotation forms ([=font specific=], OpenType feature: <span class="tag">nalt <<feature-index>></span>).
5961+
<dt><dfn id="annotation" title="annotation">annotation(<<font-feature-value-name>>)</dfn>
5962+
<dd>Enables display of alternate annotation forms ([=font specific=], OpenType feature: <span class="tag">nalt <<font-feature-index>></span>).
59635963

59645964
<div class="featex">
59655965
<img alt="alternate annotation form example" src="images/nalt.png" width="350" height="62">
@@ -6107,11 +6107,21 @@ Defining font specific alternates: the <dfn>@font-feature-values</dfn> rule</h3>
61076107
and the value must be a list of one or more non-negative <<integer>>s.
61086108

61096109
The [=feature value blocks=] accept any declaration name;
6110-
these names must be identifiers,
6110+
these names must be <<font-feature-value-name>>,
61116111
per standard CSS syntax rules,
61126112
and are [=case-sensitive=]
61136113
(so <css>foo: 1;</css> and <css>FOO: 2</css> define two different features).
6114-
Each declaration's value must match the grammar ''<<integer [0,∞]>>+'',
6114+
6115+
Each declaration's value in ''@annotation'', ''@ornaments'', ''@stylistic'', ''@swash'',
6116+
must match the grammar <<font-feature-index>>,
6117+
or else the declaration is invalid and must be ignored.
6118+
6119+
Each declaration’s value in ''@character-variant''
6120+
must match the grammar <<font-feature-index [0,99]>> <<font-feature-index [0,∞]>>,
6121+
or else the declaration is invalid and must be ignored.
6122+
6123+
Each declaration’s value in ''@styleset''
6124+
must match the grammar <<font-feature-index [0,20]>>+,
61156125
or else the declaration is invalid and must be ignored.
61166126

61176127
Note: Each feature name is unique only within a single [=feature value block=].
@@ -6520,7 +6530,7 @@ Overall shorthand for font rendering: the 'font-variant!!property' property</h3>
65206530

65216531
<pre class="propdef">
65226532
Name: font-variant
6523-
Value: normal | none | [ [ <<common-lig-values>> || <<discretionary-lig-values>> || <<historical-lig-values>> || <<contextual-alt-values>> ] || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || [ stylistic(<<feature-value-name>>) || historical-forms || styleset(<<feature-value-name>>#) || character-variant(<<feature-value-name>>#) || swash(<<feature-value-name>>) || ornaments(<<feature-value-name>>) || annotation(<<feature-value-name>>) ] || [ <<numeric-figure-values>> || <<numeric-spacing-values>> || <<numeric-fraction-values>> || ordinal || slashed-zero ] || [ <<east-asian-variant-values>> || <<east-asian-width-values>> || ruby ] || [ sub | super ] || [ text | emoji | unicode ] ]
6533+
Value: normal | none | [ [ <<common-lig-values>> || <<discretionary-lig-values>> || <<historical-lig-values>> || <<contextual-alt-values>> ] || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || [ stylistic(<<font-feature-value-name>>) || historical-forms || styleset(<<font-feature-value-name>>#) || character-variant(<<font-feature-value-name>>#) || swash(<<font-feature-value-name>>) || ornaments(<<font-feature-value-name>>) || annotation(<<font-feature-value-name>>) ] || [ <<numeric-figure-values>> || <<numeric-spacing-values>> || <<numeric-fraction-values>> || ordinal || slashed-zero ] || [ <<east-asian-variant-values>> || <<east-asian-width-values>> || ruby ] || [ sub | super ] || [ text | emoji | unicode ] ]
65246534
Initial: normal
65256535
Applies to: all elements and text
65266536
Inherited: yes

0 commit comments

Comments
 (0)