Skip to content

Commit e8cc1fc

Browse files
committed
[css-fonts-4] port font-variant-alternates from Fonts 3
1 parent 03c7da2 commit e8cc1fc

7 files changed

Lines changed: 54 additions & 0 deletions

File tree

css-fonts-4/Overview.bs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2835,6 +2835,60 @@ p { font-variant-alternates: swash(unknown-value); } /* not a defined value, ign
28352835
p { font-variant-alternates: normal; }
28362836
</pre>
28372837

2838+
This allows values to be defined and used for a given set of font
2839+
families but ignored if fallback occurs, since the font family name
2840+
would be different. If a given value is outside the range supported by
2841+
a given font, the value is ignored. These values never apply to
2842+
generic font families.
2843+
2844+
Individual values have the following meanings:
2845+
2846+
<dl dfn-for="font-variant-alternates" dfn-type="value">
2847+
<dt><dfn id="font-variant-alternates-normal-value" title="normal!!font-variant-alternates">normal</dfn>
2848+
<dd>None of the features listed below are enabled.</dd>
2849+
2850+
<dt><dfn>historical-forms</dfn>
2851+
<dd>Enables display of historical forms (OpenType feature: <span class="tag">hist</span>).</dd>
2852+
2853+
<div class="featex"><img alt="historical form example" src="images/hist.png"></div>
2854+
2855+
<dt><dfn id="stylistic" title="stylistic">stylistic(&lt;feature-value-name&gt;)</dfn>
2856+
<dd>Enables display of stylistic alternates (<em>font specific</em>, OpenType feature: <span class="tag">salt &lt;feature-index&gt;</span>).</dd>
2857+
2858+
<div class="featex"><img alt="stylistic alternate example" src="images/salt.png"></div>
2859+
2860+
<dt><dfn id="styleset" title="styleset">styleset(&lt;feature-value-name&gt; #)</dfn>
2861+
<dd>Enables display with stylistic sets (<em>font specific</em>, OpenType feature: <span class="tag">ss&lt;feature-index&gt;</span>
2862+
OpenType currently defines <span class="tag">ss01</span> through <span class="tag">ss20</span>).</dd>
2863+
2864+
<div class="featex"><img alt="styleset example" src="images/ssnn.png"></div>
2865+
2866+
<dt><dfn id="character-variant" title="character-variant">character-variant(&lt;feature-value-name&gt; #)</dfn>
2867+
<dd>Enables display of specific character variants (<em>font specific</em>, OpenType feature: <span class="tag">cv&lt;feature-index&gt;</span>
2868+
OpenType currently defines <span class="tag">cv01</span> through <span class="tag">cv99</span>).</dd>
2869+
2870+
<dt><dfn id="swash" title="swash">swash(&lt;feature-value-name&gt;)</dfn>
2871+
<dd>Enables display of swash glyphs (<em>font specific</em>, OpenType feature: <span class="tag">swsh &lt;feature-index&gt;, cswh &lt;feature-index&gt;</span>).</dd>
2872+
2873+
<div class="featex"><img alt="swash example" src="images/swsh.png"></div>
2874+
2875+
<dt><dfn id="ornaments" title="ornaments">ornaments(&lt;feature-value-name&gt;)</dfn>
2876+
<dd>Enables replacement of default glyphs with ornaments, if provided in the font (<em>font specific</em>, OpenType feature: <span class="tag">ornm &lt;feature-index&gt;</span>).
2877+
Some fonts may offer ornament glyphs as alternates for a wide collection of characters; however, displaying arbitrary
2878+
characters (e.g., alphanumerics) as ornaments is poor practice as it distorts the semantics of the data. Font designers
2879+
are encouraged to encode all ornaments (except those explicitly encoded in the Unicode Dingbats blocks, etc.) as
2880+
alternates for the bullet character (U+2022) to allow authors to select the desired glyph using 'ornaments'.
2881+
</dd>
2882+
2883+
<div class="featex"><img alt="ornaments example" src="images/ornm.png"></div>
2884+
2885+
<dt><dfn id="annotation" title="annotation">annotation(&lt;feature-value-name&gt;)</dfn>
2886+
<dd>Enables display of alternate annotation forms (<em>font specific</em>, OpenType feature: <span class="tag">nalt &lt;feature-index&gt;</span>).</dd>
2887+
2888+
<div class="featex"><img alt="alternate annotation form example" src="images/nalt.png"></div>
2889+
2890+
</dl>
2891+
28382892
Issue: Moved to Level 4; port the text for this from Fonts 3 .src to Fonts 4 .bs
28392893

28402894
<h3 id="font-feature-values">

css-fonts-4/images/hist.png

2.73 KB
Loading

css-fonts-4/images/nalt.png

3.41 KB
Loading

css-fonts-4/images/ornm.png

2.67 KB
Loading

css-fonts-4/images/salt.png

2.92 KB
Loading

css-fonts-4/images/ssnn.png

5.35 KB
Loading

css-fonts-4/images/swsh.png

3.67 KB
Loading

0 commit comments

Comments
 (0)