Skip to content

Commit 9f0383e

Browse files
davidsgrogansvgeesus
authored andcommitted
non-uniform scaling + many editorial changes
1 parent b78dae7 commit 9f0383e

File tree

1 file changed

+50
-43
lines changed

1 file changed

+50
-43
lines changed

css-fonts-5/Overview.bs

Lines changed: 50 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ rules defined in CSS Fonts Level 4.
6060
This specification is currently a delta to the CSS Fonts Level 4 specification.
6161
Do not assume that if something is not here, it has been dropped.
6262

63+
64+
6365
<h3 id="values">
6466
Value Definitions</h3>
6567

@@ -74,36 +76,41 @@ also accept the <a>CSS-wide keywords</a> as their property value.
7476
For readability they have not been repeated explicitly.
7577

7678
<h2 id="text-scale-meta">
77-
Text-Scale <code class=html>&lt;meta&gt;</code> element</h2>
79+
Text-Scale <{meta}> element</h2>
7880

7981
The <dfn>text scale factor</dfn> is a multiplier
8082
used to calculate the computed value of the ''font-size/medium'' font size.
8183
The computed value of ''font-size/medium''
8284
is 16px
8385
multiplied by the [=text scale factor=].
84-
This factor consequently
85-
scales the computed size of the other <<absolute-size>> keywords.
86+
This factor also
87+
affects the computed size of the other <<absolute-size>> keywords,
88+
but not necessarily by the same factor as ''font-size/medium''.
89+
The UA should non-uniformly adjust
90+
keywords other than ''font-size/medium'' for improved readability.
91+
92+
Note: Scaling all font sizes uniformly would lead to large fonts being too large.
93+
See <a href="https://github.com/w3c/wcag3/issues/261#issuecomment-2598860630">
94+
WCAG discussion about minimum and maximum critical font sizes</a>.
8695

8796
A document with a <{meta}> tag
8897
whose <{meta/name}> attribute
89-
is a <a>ASCII case-insensitive</a> match for
90-
<dfn lt=text-scale><code>"text-scale"</code></dfn>
98+
is an <a>ASCII case-insensitive</a> match for
99+
<dfn lt="text-scale" export><code>"text-scale"</code></dfn>
91100
is recognized as controlling the [=text scale factor=].
92101

93-
Issue(12475):
94-
95-
The value of the <code>content</code>
102+
The value of the <{meta/content}>
96103
attribute must be an <a>ASCII case-insensitive</a> match for one of the
97104
recognized keywords. Otherwise the tag is ignored.
98105

99106
Documents without this <{meta}> tag will have an assumed default
100-
value of <code>legacy</code>.
107+
value of <a for="text-scale">legacy</a>.
101108

102109
<div class="example" id="ex-text-scale">
103-
<pre>&lt;meta name="text-scale" content="scale" /></pre>
110+
<pre class="lang-html">&lt;meta name="text-scale" content="scale" /></pre>
104111
</div>
105112

106-
There must not be more than one <{meta}> element with its <{meta/name}> attribute value set to an [=ASCII case-insensitive=] for [=text-scale=] per document.
113+
There must not be more than one <{meta}> element with its <{meta/name}> attribute value set to an [=ASCII case-insensitive=] match for [=text-scale=] per document.
107114

108115
<h3 id="text-scale-meta-keywords">
109116
Keywords</h3>
@@ -113,49 +120,47 @@ The recognized keywords in the [=text-scale=]
113120

114121
<dl>
115122
<dt><dfn for="text-scale">legacy</dfn></dt>
116-
<dd>The ''env()/preferred-text-scale'' environment variable returns the user's OS-level font factor on mobile,
117-
but 1 on desktop.
118-
The document's ''font-size/medium'' font size incorporates UA-level font preferences.
119-
OS-level font preferences are ignored.
123+
<dd>
124+
The ''env()/preferred-text-scale'' environment variable returns the user's OS-level font factor on mobile devices,
125+
but 1 on desktop devices.
126+
[=text scale factor=] incorporates UA-level font preferences but
127+
OS-level font preferences are ignored.
120128

121-
Note: Equivalent to omitting a [=text-scale=] <{meta}> tag or
122-
including an unrecognized content attribute keyword.
129+
Note: Equivalent to omitting a [=text-scale=] <{meta}> tag or
130+
including an unrecognized content attribute keyword.
131+
</dd>
132+
<dt><dfn for="text-scale">scale</dfn></dt>
133+
<dd>
134+
The ''env()/preferred-text-scale'' environment variable returns the user's OS-level font preferences.
135+
[=text scale factor=] incorporates both UA-level and OS-level font preferences.
123136
</dd>
124-
<dt><dfn>scale</dfn></dt>
125-
<dd>The ''env()/preferred-text-scale'' environment variable returns the user's OS-level font preferences.
126-
The document's ''font-size/medium'' font size incorporates both UA-level and OS-level font preferences.</dd>
127137
</dl>
128138

129-
<h3 id="legacy-keyword">The 'legacy' keyword</h3>
139+
<h3 id="legacy-keyword">The <a for="text-scale">legacy</a> keyword</h3>
130140

131141
When the value of the [=text-scale=] content attribute is
132142
[=text-scale/legacy=],
133143
the [=text scale factor=] is the font scale factor
134-
the user has chosen from any settings <i>provided by the user agent</i>.
135-
The ''preferred-text-scale'' environment variable value must be 1 on desktop platforms.
136-
On mobile:
137-
<ul>
138-
<li>if the operating system provides a text scale setting AND
139-
the UA hasn't already applied that factor to the ''font-size/medium'' font size,
140-
the ''env()/preferred-text-scale'' environment variable returns the multiplier
141-
that the user has chosen in the operating system's text scale setting.
144+
the user has chosen from any settings provided <i>only</i> by the user agent.
145+
The ''env()/preferred-text-scale'' environment variable value must be 1 on desktop platforms.
142146

143-
Note: At the time of publishing, all combinations of
144-
Android, iOS,
145-
Firefox, Safari, Chrome
146-
satisfy this first condition.
147+
On mobile platforms:
148+
<ul>
149+
<li>
150+
If the operating system provides a text scale setting AND
151+
the UA hasn't already applied that factor to the ''font-size/medium'' font size,
152+
the ''env()/preferred-text-scale'' environment variable returns the multiplier
153+
that the user has chosen in the operating system's text scale setting.
147154

155+
Note: At the time of publishing, all combinations of Android, iOS, Firefox, Safari, and Chrome satisfy this first condition.
148156
</li>
149157
<li>Otherwise the ''env()/preferred-text-scale'' environment variable returns 1.</li>
150158
</ul>
151159

152160
<h3 id="scale-keyword">The 'scale' keyword</h3>
153161

154-
The <dfn for="text-scale" export><code>scale</code></dfn> property is
155-
recognized in the [=text-scale=] content attribute value.
156-
157162
When the value of the [=text-scale=] content attribute is
158-
<a for=text-scale>scale</a>,
163+
<a for="text-scale">scale</a>,
159164
the [=text scale factor=] matches the user's preferred paragraph text size
160165
(as determined from a combination of OS and UA preferences)
161166
divided by 16px.
@@ -165,34 +170,36 @@ The ''env()/preferred-text-scale'' environment variable must return the [=text s
165170
Further, when the value of the [=text-scale=] content attribute is
166171
<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-application 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>.
167172

168-
Note: Authors are expected to use
169-
''&lt;meta name="text-scale" content="scale"&gt;'' in stylesheets so that the ''font-size/medium'' font size will reflect a combination 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.
173+
Note:
174+
Authors are expected to use
175+
<code>&lt;meta name="text-scale" content="scale"&gt;</code> in stylesheets so that the ''font-size/medium'' font size will reflect a combination 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.
170176

171177
<div class="example" id="ex-scaled-page">
172178
If authors don't alter the '':root'' font size, content sized with ''rem'' units will be relative to the preferred text scale
173-
<pre>
179+
<pre class="lang-html">
174180
&lt;!DOCTYPE html>
175181
&lt;html> &lt;!-- leave this element's font-size as the default -->
176182
&lt;head>
177183
&lt;meta name="text-scale" content="scale" />
178184
&lt;/head>
179185
&lt;body>
180186
&lt;div style="font-size: 1rem;">
181-
This font size obeys the user's font preferences, **whether
187+
This font size obeys the user's font preferences, **whether
182188
those preferences are specified at the operating system level
183189
or the user agent level**
184190
&lt;/div>
185191
&lt;div style="font-size: 20px;">
186-
This font size does NOT respect the user's font preferences.
192+
This font size does NOT respect the user's font preferences.
187193
&lt;div style="font-size: 1rem;">
188-
But this font size does!
194+
But this font size does!
189195
&lt;/div>
190196
&lt;/div>
191197
&lt;/body>
192198
&lt;/html>
193199
</pre>
194200
</div>
195201

202+
196203
<h2 id="basic-font-props">
197204
Basic Font Properties</h2>
198205

0 commit comments

Comments
 (0)