Skip to content

Commit 64cb44b

Browse files
committed
[css-fonts] Move font-language-override from level 3 to Level 4, fix #1104
1 parent 99144fc commit 64cb44b

File tree

2 files changed

+97
-115
lines changed

2 files changed

+97
-115
lines changed

css-fonts-3/Fonts.src.html

Lines changed: 7 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ <h3 class="no-num no-toc" id="atrisk">Features at risk</h3>
174174

175175
<ul>
176176
<li>fallback handling for text decoration in superscript/subscript variant glyphs ('font-variant-position')</li>
177-
<li>'font-language-override' property</li>
178177
<li>The <em>font specific</em> functions accepted by 'font-variant-alternates' and 'font-variant'. This includes the entire <code>@font-feature-values</code> at-rule, as well as the following functions:
179178
<ul>
180179
<li><a href="#stylistic">stylistic()</a></li>
@@ -1272,9 +1271,9 @@ <h3 id="font-prop">Shorthand font property: the <a href="#propdef-font">font</a>
12721271
<p>All subproperties of the 'font' property are first reset to their initial values,
12731272
including those listed above plus
12741273
<span class="property">'font-size-adjust'</span>,
1275-
<span class="property">'font-kerning'</span>, all subproperties of <span title="font-variant!!property">'font-variant'</span>,
1274+
<span class="property">'font-kerning'</span>, all subproperties of <span title="font-variant!!property">'font-variant'</span>, and
12761275
<span class="property">'font-feature-settings'</span>,
1277-
and <span class="property">'font-language-override'</span>,
1276+
12781277
but <em>not</em> <span class="property">'font-synthesis'</span>.
12791278
Then, those properties that are given explicit values in the <span class="property">'font'</span>
12801279
shorthand are set to those values. For a definition of allowed and
@@ -2795,13 +2794,7 @@ <h3 id="language-specific-support">Language-specific display</h3>
27952794
the content language and use that when selecting and positioning
27962795
glyphs using an OpenType font.</p>
27972796

2798-
<p>For OpenType fonts, in some cases it may be necessary to explicitly
2799-
declare the OpenType language to be used, for example when displaying
2800-
text in a given language that uses the typographic conventions of
2801-
another language or when the font does not explicitly support a given
2802-
language but supports a language that shares common typographic
2803-
conventions. The 'font-language-override' property is used for this
2804-
purpose.</p>
2797+
28052798

28062799
<!-- prop: font-kerning -->
28072800

@@ -4075,7 +4068,7 @@ <h3 id="font-variant-prop">Overall shorthand for font rendering: the <a href="#p
40754068
value. The <dfn id="font-variant-none-value" title="none!!font-variant">'none'</dfn> value sets 'font-variant-ligatures' to 'none' and resets all other
40764069
font feature properties to their initial value. Like other shorthands,
40774070
using <span title="font-variant!!property">'font-variant'</span> resets unspecified <span title="font-variant!!property">'font-variant'</span> subproperties to their initial
4078-
values. It does not reset the values of either 'font-language-override' or
4071+
values. It does not reset the values of <!-- either 'font-language-override' or -->
40794072
<span title="font-feature-settings!!property">'font-feature-settings'</span>.</p>
40804073

40814074

@@ -4211,107 +4204,6 @@ <h3 id="font-feature-settings-prop">Low-level font feature settings control: the
42114204
</pre>
42124205
</div>
42134206

4214-
<h3 id="font-language-override-prop">Font language override: the <a href="#propdef-font-language-override">font-language-override</a> property</h3>
4215-
<table class="propdef">
4216-
<tbody>
4217-
<tr>
4218-
<td>Name:</td>
4219-
<td><dfn id="propdef-font-language-override">font-language-override</dfn></td>
4220-
</tr>
4221-
<tr>
4222-
<td>Value:</td>
4223-
<td><span title="normal!!font-language-override">normal</span> | <var>&lt;string&gt;</var></td>
4224-
</tr>
4225-
<tr>
4226-
<td>Initial:</td>
4227-
<td><span title="normal!!font-language-override">normal</span></td>
4228-
</tr>
4229-
<tr>
4230-
<td>Applies to:</td>
4231-
<td>all elements</td>
4232-
</tr>
4233-
<tr>
4234-
<td>Inherited:</td>
4235-
<td>yes</td>
4236-
</tr>
4237-
<tr>
4238-
<td>Percentages:</td>
4239-
<td>N/A</td>
4240-
</tr>
4241-
<tr>
4242-
<td>Media:</td>
4243-
<td>visual</td>
4244-
</tr>
4245-
<tr>
4246-
<td>Computed&nbsp;value:</td>
4247-
<td>as specified</td>
4248-
</tr>
4249-
<tr>
4250-
<td>Animatable:</td>
4251-
<td>no</td>
4252-
</tr>
4253-
</tbody>
4254-
</table>
4255-
4256-
<p>Normally, authors can control the use of language-specific glyph substitutions and positioning
4257-
by setting the content language of an element, as <a href="#language-specific-support">described above</a>:</p>
4258-
4259-
<pre>&lt;!-- Display text using S'gaw Karen specific features -->
4260-
&lt;p lang="ksw">...&lt;/p></pre>
4261-
4262-
<p>In some cases, authors may need to specify a language system
4263-
that differs from the content language, for example due to the need to mimic another language's
4264-
typographic traditions. The 'font-language-override' property allows authors to explicitly specify
4265-
the language system of the font, overriding the language system implied by the content language.</p>
4266-
4267-
<p>Values have the following meanings:</p>
4268-
4269-
<dl>
4270-
<dt><dfn id="font-language-override-normal-value" title="normal!!font-language-override">normal</dfn></dt>
4271-
<dd>specifies that when rendering with OpenType fonts,
4272-
the content language of the element is used to infer the OpenType language system</dd>
4273-
<dt><dfn data-dfn-type=value data-dfn-for=font-language-override id="font-language-override-string-value"><var>&lt;string&gt;</var></dfn></dt>
4274-
<dd>single three-letter case-sensitive OpenType <a href="https://www.microsoft.com/typography/otspec/languagetags.htm">language system tag</a>,
4275-
specifies the OpenType language system to be used instead of the language system implied by the language of the element</dd>
4276-
</dl>
4277-
4278-
<!-- For this level, string represents a single language code, there's no concept of "fallback"
4279-
https://www.w3.org/2013/06/07-css-minutes.html#item04 -->
4280-
4281-
<p>Use of invalid OpenType language system tags must not generate a
4282-
parse error but must be ignored when doing glyph selection and
4283-
placement.</p>
4284-
4285-
<div class="example">
4286-
<p>The <a href="https://www.un.org/en/documents/udhr/index.shtml">Universal Declaration of Human Rights</a> has
4287-
been translated into a wide variety of languages. In Turkish, Article 9 of this document might be marked up as below:</p>
4288-
4289-
<pre lang="tr">&lt;body lang="tr">
4290-
4291-
&lt;h4>Madde 9&lt;/h4>
4292-
&lt;p>Hiç kimse keyfi olarak tutuklanamaz, alıkonulanamaz veya sürülemez.&lt;/p>
4293-
</pre>
4294-
4295-
<p>Here the user agent uses the value of the 'lang' attribute when rendering text and
4296-
appropriately renders this text without 'fi' ligatures. There is no need
4297-
to use the 'font-language-override' property.</p>
4298-
4299-
<p>However, a given font may lack support for a specific language. In this
4300-
situation authors may need to use the typographic conventions of a related language
4301-
that are supported by that font:</p>
4302-
4303-
<pre lang="mk">&lt;body lang="mk"> &lt;!-- Macedonian lang code --&gt;
4304-
4305-
body { font-language-override: "SRB"; /* Serbian OpenType language tag */ }
4306-
4307-
&lt;h4>Члeн 9&lt;/h4>
4308-
&lt;p>Никoj чoвeк нeмa дa бидe пoдлoжeн нa прoизвoлнo aпсeњe, притвoр или прoгoнувaњe.&lt;/p>
4309-
4310-
</pre>
4311-
4312-
<p>The Macedonian text here will be rendered using Serbian typographic conventions, with the
4313-
assumption that the font specified supports Serbian.</p>
4314-
</div>
43154207

43164208
<a id="rendering-considerations"></a>
43174209
<h2 id="font-feature-resolution">Font Feature Resolution</h3>
@@ -4638,15 +4530,16 @@ <h3 class="no-num" id="recent-changes">
46384530
Changes from the <a href="https://www.w3.org/TR/2013/CR-css-fonts-3-20131003/">October 2013 CSS3 Fonts Candidate Recommendation</a></h3>
46394531

46404532
<ul>
4533+
<li>'font-language-override' property moved to Fonts 4</li>
46414534
<li>add omitted 'font-variant-position' values to <span title="font-variant!!property">'font-variant'</span> shorthand</li>
4642-
<li>make negative values for font-size-adjust invalid, along with negative percentage font-size values</li>
4535+
<li>made negative values for font-size-adjust invalid, along with negative percentage font-size values</li>
46434536
<li>remove the requirement that user agents use OS/2 table subscript/superscript metrics</li>
46444537
<li>minor editorial cleanups</li>
46454538
</ul>
46464539

46474540
<h2 class=no-num id=acknowledgments>Acknowledgments</h2>
46484541

4649-
<p>I'd like to thank Tal Leming, Jonathan Kew and Christopher Slye for
4542+
<p>We'd like to thank Tal Leming, Jonathan Kew, Ken Lunde and Christopher Slye for
46504543
all their help and feedback. John Hudson was kind enough to take the
46514544
time to explain the subtleties of OpenType language tags and provided
46524545
the example of character variant usage for displaying text on

css-fonts-4/Overview.bs

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ spec:css-fonts-3;
2222
text:unicode-range
2323
type:property; for:/;
2424
text:font-kerning
25-
text:font-language-override
2625
</pre>
2726

2827
Advisement: This document contains ideas and
@@ -2716,6 +2715,15 @@ to specific font features.
27162715
<h3 id="language-specific-support">
27172716
Language-specific display</h3>
27182717

2718+
<!-- previously in level 3, now moved to Level 4 -->
2719+
For OpenType fonts, in some cases it may be necessary to explicitly
2720+
declare the OpenType language to be used, for example when displaying
2721+
text in a given language that uses the typographic conventions of
2722+
another language or when the font does not explicitly support a given
2723+
language but supports a language that shares common typographic
2724+
conventions. The 'font-language-override' property is used for this
2725+
purpose.
2726+
27192727
<h3 id="font-kerning-prop">
27202728
Kerning: the 'font-kerning' property</h3>
27212729

@@ -2798,6 +2806,87 @@ Overall shorthand for font rendering: the 'font-variant!!property' property</h3>
27982806
Low-level font feature settings control: the 'font-feature-settings' property</h3>
27992807

28002808

2809+
<h3 id="font-language-override-prop">Font language override: the 'font-language-override' property</h3>
2810+
2811+
<pre class="propdef">
2812+
Name: font-language-override
2813+
Value: normal | <<string>>
2814+
Initial: normal
2815+
Applies to: all elements
2816+
Inherited: yes
2817+
Percentages: N/A
2818+
Computed value: as specified
2819+
Media: visual
2820+
Animatable: no
2821+
</pre>
2822+
2823+
Normally, authors can control the use of language-specific glyph substitutions and positioning
2824+
by setting the content language of an element, as <a href="#language-specific-support">described
2825+
above</a>:
2826+
2827+
<pre>&lt;!-- Display text using S'gaw Karen specific features -->
2828+
&lt;p lang="ksw">...&lt;/p></pre>
2829+
2830+
In some cases, authors may need to specify a language system
2831+
that differs from the content language, for example due to the need to mimic another language's
2832+
typographic traditions. The 'font-language-override' property allows authors to explicitly specify
2833+
the language system of the font, overriding the language system implied by the content language.
2834+
2835+
Values have the following meanings:
2836+
2837+
<dl>
2838+
<dt><dfn id="font-language-override-normal-value" title="normal!!font-language-override">normal</dfn></dt>
2839+
<dd>specifies that when rendering with OpenType fonts,
2840+
the content language of the element is used to infer the OpenType language system</dd>
2841+
<dt><dfn data-dfn-type=value data-dfn-for=font-language-override id="font-language-override-string-value"><var>&lt;string&gt;</var></dfn></dt>
2842+
<dd>single three-letter case-sensitive OpenType <a href="https://www.microsoft.com/typography/otspec/languagetags.htm">language system tag</a>,
2843+
specifies the OpenType language system to be used instead of the language system implied by the language of the element</dd>
2844+
</dl>
2845+
2846+
<!-- For this level, string represents a single language code, there's no concept of "fallback"
2847+
https://www.w3.org/2013/06/07-css-minutes.html#item04 -->
2848+
2849+
<!-- this para replaced, https://github.com/w3c/csswg-drafts/issues/1104
2850+
2851+
Use of invalid OpenType language system tags must not generate a
2852+
parse error but must be ignored when doing glyph selection and
2853+
placement.
2854+
-->
2855+
2856+
Unknown OpenType language system tags are silently ignored, and do not affect
2857+
glyph selection and placement.
2858+
2859+
<div class="example">
2860+
The <a href="https://www.un.org/en/documents/udhr/index.shtml">Universal Declaration of
2861+
Human Rights</a> has been translated into a wide variety of languages. In Turkish,
2862+
Article 9 of this document might be marked up as below:
2863+
2864+
<pre lang="tr">&lt;body lang="tr">
2865+
2866+
&lt;h4>Madde 9&lt;/h4>
2867+
&lt;p>Hiç kimse keyfi olarak tutuklanamaz, alıkonulanamaz veya sürülemez.&lt;/p>
2868+
</pre>
2869+
2870+
Here the user agent uses the value of the 'lang' attribute when rendering text and
2871+
appropriately renders this text without 'fi' ligatures. There is no need
2872+
to use the 'font-language-override' property.
2873+
2874+
However, a given font may lack support for a specific language. In this
2875+
situation authors may need to use the typographic conventions of a related language
2876+
that are supported by that font:
2877+
2878+
<pre lang="mk">&lt;body lang="mk"> &lt;!-- Macedonian lang code --&gt;
2879+
2880+
body { font-language-override: "SRB"; /* Serbian OpenType language tag */ }
2881+
2882+
&lt;h4>Члeн 9&lt;/h4>
2883+
&lt;p>Никoj чoвeк нeмa дa бидe пoдлoжeн нa прoизвoлнo aпсeњe, притвoр или прoгoнувaњe.&lt;/p>
2884+
2885+
</pre>
2886+
2887+
As the content creator knows that font specified supports Serbian, the Macedonian text
2888+
here will be rendered using Serbian typographic conventions.
2889+
</div>
28012890

28022891
<h2 id="font-feature-variation-resolution">
28032892
Font Feature and Variation Resolution</h3>

0 commit comments

Comments
 (0)