Skip to content

Commit df02447

Browse files
committed
[css-fonts-5] Split out size-adjust from metric overrides section #6112 and improve its description #6133.
1 parent 91413ca commit df02447

File tree

1 file changed

+36
-25
lines changed

1 file changed

+36
-25
lines changed

css-fonts-5/Overview.bs

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,43 @@ Issue(5892):
139139
</dl>
140140

141141

142-
142+
<h3 id="size-adjust-desc">
143+
Glyph Size Multiplier:
144+
the 'size-adjust' descriptor</h3>
145+
146+
<pre class='descdef'>
147+
Name: size-adjust
148+
Value: normal | <<percentage>>
149+
For: @font-face
150+
Initial: normal
151+
</pre>
152+
153+
The 'size-adjust' descriptor defines a multiplier
154+
for glyph outlines and metrics associated with this font,
155+
to allow the author to harmonize the designs of various fonts
156+
when rendered at the same 'font-size'.
157+
158+
All metrics associated with this font--
159+
including glyph advances, baseline tables, and overrides provided by ''@font-face'' descriptors--
160+
are scaled by the given percentage,
161+
as are the rendered glyph images.
162+
Consequently,
163+
any units derived from font metrics (such as ''ex'' and ''ch'')
164+
are also affected when sourced from this font.
165+
However, the [=computed value|computed=] 'font-size'
166+
(and thus any units such as ''em'' that derive from it)
167+
remains unaffected.
168+
169+
Note: The 'size-adjust' descriptor functions similarly to
170+
the 'font-size-adjust' property,
171+
which essentially calculates an adjustment per font by matching ex heights,
172+
but likewise does not affect the [=computed value|computed=] 'font-size'.
143173

144174
<!-- should this stay in Fonts 4 or be here in Fonts 5? -->
145175

146176
<h3 id="font-metrics-override-desc">
147177
Default font metrics overriding:
148-
the 'ascent-override', 'descent-override', 'line-gap-override', and 'size-adjust' descriptors</h3>
178+
the 'ascent-override', 'descent-override', and 'line-gap-override' descriptors</h3>
149179

150180
<pre class='descdef'>
151181
Name: ascent-override
@@ -168,17 +198,9 @@ For: @font-face
168198
Initial: normal
169199
</pre>
170200

171-
<pre class='descdef'>
172-
Name: size-adjust
173-
Value: normal | <<percentage>>
174-
For: @font-face
175-
Initial: normal
176-
</pre>
177-
178201
The 'ascent-override', 'descent-override', and 'line-gap-override' descriptors define the
179202
<a spec="CSS-INLINE-3">ascent metric</a>, <a spec="CSS-INLINE-3">descent metric</a> and
180-
<a spec="CSS-INLINE-3">line gap metric</a> of the font, respectively. The `size-adjust`
181-
descriptor defines a scalar by which glyph outlines and metrics from this font are multiplied.
203+
<a spec="CSS-INLINE-3">line gap metric</a> of the font, respectively.
182204

183205
When the descriptor value is 'normal', the corresponding metric value is obtained as-if the
184206
descriptor was absent from the <code>@font-face</code> block.
@@ -190,27 +212,16 @@ For the 'ascent-override', 'descent-override' and 'line-gap-override' descriptor
190212
descriptor value is a percentage, the corresponding metric value is resolved as the
191213
given percentage multiplied by the used font size. Negative values are invalid at parse time.
192214

193-
For 'size-adjust', when the descriptor value is a percentage, all metrics values of this font,
194-
including glyph advance sizes, are resolved as the given percentage multiplied by the used font
195-
size. When glyphs are visibly drawn, the visual size of the glyphs is also multiplied by the
196-
percentage.
197-
198215
None of these descriptors affect the calculation of
199216
<a href="https://drafts.csswg.org/css-values-4/#font-relative-lengths">Font-relative Lengths</a>.
200217
None of these descriptors affect the behavior of any of the values of 'line-height' other than
201218
'normal'. The behavior of <code>line-height: normal</code> may be affected by all of these
202-
descriptors. 'size-adjust' does not affect the computed font size of any element.
203-
204-
When 'size-adjust' is applied in conjunction with 'ascent-override', 'descent-override',
205-
or 'line-gap-override' in the same @font-face block, the relevant metrics are multiplied by both
206-
percentages.
219+
descriptors.
207220

208221
Note: Using the 'ascent-override', 'descent-override', and 'line-gap-override' descriptors can
209-
achieve a similar effect as specifying a percentage for 'line-height' property. Using the
210-
'size-adjust' descriptor can achieve a similar effect as specifying a percentage for the
211-
'font-size' property.
222+
achieve a similar effect as specifying a percentage for 'line-height' property.
212223

213-
Note: 'ascent-override', 'descent-override', 'line-gap-override', and 'size-adjust'
224+
Note: 'ascent-override', 'descent-override', and 'line-gap-override'
214225
are applied per-font rather than per-element. Multiple fonts may be used
215226
within an individual element e.g. for characters not supported by the primary font.
216227

0 commit comments

Comments
 (0)