Skip to content

Commit c7d96b2

Browse files
davidsgrogansvgeesus
authored andcommitted
no bs edits
1 parent a377761 commit c7d96b2

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

css-fonts-5/Overview.bs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,64 @@ rules defined in CSS Fonts Level 4.
5959
This specification is currently a delta to the CSS Fonts Level 4 specification.
6060
Do not assume that if something is not here, it has been dropped.
6161

62+
<h2 id="text-scale-meta">
63+
Text-Scale <code class=html>&lt;meta&gt;</code> element</h2>
6264

65+
A document with a <code>&lt;meta></code> tag whose <code>name</code> attribute
66+
is a <a>ASCII case-insensitive</a> match for
67+
<dfn lt=text-scale><code>"text-scale"</code></dfn> is recognized as setting the
68+
initial font size of the document. The value of the <code>content</code>
69+
attribute must be an <a>ASCII case-insensitive</a> match for one of the
70+
recognized keywords.
71+
72+
Documents without this <code>&lt;meta></code> tag will have an assumed default
73+
value of <code>legacy</code>.
74+
75+
<h3 id="text-scale-meta-keywords">
76+
Keywords</h3>
77+
78+
The recognized keywords in the [=text-scale=]
79+
<code class=html>&lt;meta&gt;</code> element are:
80+
81+
<ul>
82+
<li><code class="index" lt="legacy!!text-scale-meta">legacy</code></li>
83+
<li><code class="index" lt="scale!!text-scale-meta">scale</code></li>
84+
</ul>
85+
86+
<h3 id="legacy-keyword">The 'legacy' keyword</h3>
87+
88+
The <dfn for="text-scale" export><code>legacy</code></dfn> property is
89+
recognized in the [=text-scale=] content attribute value.
90+
91+
When the value of the [=text-scale=] content attribute is
92+
<a for="text-scale">legacy</a> the user agent should set the initial font size
93+
to 16px multiplied by the font scale factor the user has chosen from any settings <i>provided by the user agent</i>. The ''preferred-text-scale'' value must be 1 on desktop platforms. On mobile:
94+
<ul>
95+
<li>if the operating system provides a text scale setting AND the UA hasn't already applied that factor to the initial font size, ''env()/preferred-text-scale'' returns the mulitplier that the user has chosen in the operating system's text scale setting.</li>
96+
<li>Otherwise ''env()/preferred-text-scale'' returns 1.</li>
97+
</ul>
98+
99+
Note: As of this writing, all combinations of Android, iOS, Gecko, WebKit, Blink qualify for the first bullet point above.
100+
101+
<h3 id="scale-keyword">The 'scale' keyword</h3>
102+
103+
The <dfn for="text-scale" export><code>scale</code></dfn> property is
104+
recognized in the [=text-scale=] content attribute value.
105+
106+
When the value of the [=text-scale=] content attribute is
107+
<a for=text-scale>scale</a> the user agent may determine the initial font size
108+
based on a combination of the operating system's text scale setting and the user agent's text scale setting. The
109+
''env()/preferred-text-scale'' value must be a number that, when multiplied by
110+
16px, provides a <<length>> that matches that of the initial font size.
111+
112+
Further, when the value of the [=text-scale=] content attribute is
113+
<a for=text-scale>scale</a>, the user agent should skip all font-sizing interventions it would otherwise perform in an attempt to automatically honor the user's preferences. E.g. text autosizing on mobile (See [[css-size-adjust#intro]]) and full-page zoom (<a href="https://github.com/w3c/csswg-drafts/blob/main/css-env-1/explainers/env-preferred-text-scale.md#windows-11">popular browsers do this on Windows)</a>.
114+
115+
See the <a href="https://github.com/w3c/csswg-drafts/blob/main/css-env-1/explainers/env-preferred-text-scale.md#windows-11">
116+
preferred text scale explainer</a> for more details.
117+
118+
Note: It is expected that authors will use
119+
''&lt;meta name="text-scale" content="scale"&gt;'' in stylesheets so that the initial font size will reflect an amalgam of the user's font preferences, whether those are specified at the OS level or the UA level. The author will then be able to use ''rem'' throughout the page to honor the user's font preferences.
63120

64121
<h3 id="values">
65122
Value Definitions</h3>

0 commit comments

Comments
 (0)