@@ -5629,20 +5629,29 @@ and be sure they're not accidentally turning on unrelated features
5629
5629
5630
5630
An ''@font-feature-values'' rule's prelude
5631
5631
contains a list of font family names,
5632
- followed by a block containing multiple << feature-value-block>> s,
5632
+ followed by a block containing multiple '' feature-value-block'' s,
5633
5633
a special type of subsidiary at-rule.
5634
- Each << feature-value-block>> contains declarations
5634
+ Each '' feature-value-block'' ' contains declarations
5635
5635
mapping author-chosen human-friendly names
5636
5636
(such as "flowing")
5637
5637
to feature indexes for the associated feature.
5638
5638
5639
- <pre class=prod>
5640
- @font-feature-values <<family-name>> # { <<declaration-rule-list>> }
5639
+ Each <<font-feature-value>> has the same meaning
5640
+ as the corresponding value of the 'font-variant-alternates' property.
5641
5641
5642
- <<feature-value-block>> = <<font-feature-value-type>> { <<declaration-list>> }
5642
+ <pre class=prod export>
5643
+ @font-feature-values = <<family-name>> # { <<declaration-rule-list>> }
5643
5644
5644
- <<font-feature-value-type>> = @stylistic | @historical-forms | @styleset | @character-variant
5645
- | @swash | @ornaments | @annotation
5645
+ <dfn for="@font-feature-values">font-feature-value-type</dfn> = <<@stylistic>> | <<@historical-forms>> | <<@styleset>> | <<@character-variant>>
5646
+ | <<@swash>> | <<@ornaments>> | <<@annotation>>
5647
+
5648
+ <dfn for="@font-feature-values">@stylistic</dfn> = @stylistic { <<declaration-list>> }
5649
+ <dfn for="@font-feature-values">@historical-forms</dfn> = @historical-forms { <<declaration-list>> }
5650
+ <dfn for="@font-feature-values">@styleset</dfn> = @styleset { <<declaration-list>> }
5651
+ <dfn for="@font-feature-values">@character-variant</dfn> = @character-variant { <<declaration-list>> }
5652
+ <dfn for="@font-feature-values">@swash</dfn> = @swash { <<declaration-list>> }
5653
+ <dfn for="@font-feature-values">@ornaments</dfn> = @ornaments { <<declaration-list>> }
5654
+ <dfn for="@font-feature-values">@annotation</dfn> = @annotation { <<declaration-list>> }
5646
5655
</pre>
5647
5656
5648
5657
<wpt>
@@ -5664,9 +5673,11 @@ and must be ignored.
5664
5673
The ''@font-feature-values'' block accepts <<declaration-rule-list>> as its contents;
5665
5674
these list items are either:
5666
5675
5667
- [=at-rules=] named by one of the <<font-feature-value-type>> at-keyword tokens,
5676
+ - [=at-rules=] named by one of the <<font-feature-value-type>> at-keyword tokens
5677
+
5668
5678
or
5669
- the '@font-feature-values/font-display' descriptor.
5679
+
5680
+ - the '@font-feature-values/font-display' descriptor.
5670
5681
5671
5682
<!-- TODO: tab says "The OM needs to make sure it exposes both .style and .childRules or whatever." -->
5672
5683
@@ -5803,11 +5814,29 @@ specific additions made per-page.
5803
5814
Multi-valued feature value definitions</h4>
5804
5815
5805
5816
Most <em> font specific</em> functional values of the 'font-variant-alternates' property
5806
- take a single value (e.g. ''swash()'' ).
5807
- The ''character-variant()'' property value allows two values
5808
- and ''styleset()'' allows an unlimited number.
5817
+ take a single value (e.g. ''swash()'' ) which enables the feature.
5818
+
5819
+ <pre class="example" id="ex-single-valued-feature" highlight=css> @font-feature-values Jupiter Serif {
5820
+
5821
+ @swash {
5822
+ swishy: 5; /* implies ss05 = 1 */
5823
+ swirly: 2; /* implies ss02 = 1 */
5824
+ }
5825
+ }
5826
+ </pre>
5809
5827
5810
- For the styleset property value, multiple values indicate the style
5828
+ The ''character-variant()'' property value and the ''@character-variant'' descriptor allow two values,
5829
+ which enables a feature (from ther first value) and sets it to a given (second) value.
5830
+
5831
+ <pre class="example" id="ex-two-valued-feature" highlight=css> @font-feature-values MM Greek {
5832
+
5833
+ @character-variant { alpha-2: 1 2; } /* implies cv01 = 2 */
5834
+ @character-variant { beta-3: 2 3; } /* implies cv02 = 3 */
5835
+ }
5836
+ </pre>
5837
+
5838
+ For the ''styleset()'' property value and ''@styleset'' rule,
5839
+ multiple values indicate the style
5811
5840
sets to be enabled. Values between 1 and 99 enable OpenType features
5812
5841
<span class="tag"> ss01</span> through <span class="tag"> ss99</span> .
5813
5842
However, the OpenType standard only officially defines
@@ -5816,7 +5845,8 @@ Multi-valued feature value definitions</h4>
5816
5845
generate a syntax error when parsed but enable no OpenType features.
5817
5846
5818
5847
5819
- <pre class="example" id="ex-multi-valued-feature"> @font-feature-values Mars Serif {
5848
+ <pre class="example" id="ex-multi-valued-feature" highlight=css> @font-feature-values Mars Serif {
5849
+
5820
5850
@styleset {
5821
5851
alt-g: 1; /* implies ss01 = 1 */
5822
5852
curly-quotes: 3; /* implies ss03 = 1 */
@@ -5837,7 +5867,7 @@ p.codeblock {
5837
5867
font-variant-alternates: styleset(curly-quotes, code);
5838
5868
}</pre>
5839
5869
5840
- For character-variant, a single value between 1 and 99 indicates
5870
+ For <<@ character-variant>> , a single value between 1 and 99 indicates
5841
5871
the enabling of OpenType feature <span class="tag"> cv01</span> through
5842
5872
<span class="tag"> cv99</span> . For OpenType fonts, values greater than
5843
5873
99 or equal to 0 are ignored but do not generate a syntax error when parsed
@@ -5848,7 +5878,8 @@ p.codeblock {
5848
5878
feature value definition</i> is
5849
5879
ignored.
5850
5880
5851
- <pre class="example" id="ex-greek-variant-features"> @font-feature-values MM Greek {
5881
+ <pre class="example" id="ex-greek-variant-features" highlight=css> @font-feature-values MM Greek {
5882
+
5852
5883
@character-variant { alpha-2: 1 2; } /* implies cv01 = 2 */
5853
5884
@character-variant { beta-3: 2 3; } /* implies cv02 = 3 */
5854
5885
@character-variant { epsilon: 5 3 6; } /* more than 2 values, syntax error, definition ignored */
@@ -5883,7 +5914,8 @@ p {
5883
5914
a font without variants. Note the two variants for U and N used on the
5884
5915
seal.</p>
5885
5916
5886
- <pre> @font-feature-values Athena Ruby {
5917
+ <pre highlight=css> @font-feature-values Athena Ruby {
5918
+
5887
5919
@character-variant {
5888
5920
leo-B: 2 1;
5889
5921
leo-M: 13 3;
@@ -5897,7 +5929,7 @@ p {
5897
5929
5898
5930
p {
5899
5931
font-variant: discretionary-ligatures
5900
- character-variant(leo-B, leo-M, leo-N, leo-T, leo-U);
5932
+ character-variant(leo-B, leo-M, leo-N, leo-T, leo-U);
5901
5933
}
5902
5934
5903
5935
span.alt-N {
0 commit comments