Skip to content

Commit 88b3b8e

Browse files
Add font selection caveat, don't reference hanging glyphs
1 parent 706fb9e commit 88b3b8e

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

css-text-3/Overview.bs

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8262,38 +8262,44 @@ Ink Overflow from Text</h2>
82628262
<p><em>This appendix is non-normative.</em></p>
82638263

82648264
<div class="example">
8265-
<p>The example below demonstrates a [=hanging glyph=].</p>
8265+
<p>The example below demonstrates [=ink overflow=] from text.</p>
82668266
<div class="figure" style="margin:0; font-size:10rem; font-family:garamond; font-style:italic">
82678267
<span style="display:inline-block; width:1ch; height:1lh; background:green; opacity:0.5"></span><span style="vertical-align: top;">f</span><span style="display:inline-block; width:1ch; height:1lh; background:green; opacity:0.5"></span>
82688268
</div>
82698269
</div>
82708270

8271-
Because [=hanging glyphs=] are considered [=ink overflow=],
8272-
and hence are not included in [=inline box=] geometry,
8273-
there is no straightforward way to measure their extent,
8271+
Some glyphs have a painted area that extends beyond the
8272+
bounding box described by their origin and advance.
8273+
In these cases, the extra painted area generates [=ink overflow=],
8274+
and hence is not included in [=inline box=] geometry.
8275+
There is no straightforward way to measure the extent
8276+
of [=ink overflow=] generated by these glyphs,
82748277
or to pre-compute padding or margin lengths that will
8275-
prevent [=hanging glyphs=] from overlapping adjacent content.
8276-
The extent of [=ink overflow=] from [=hanging glyphs=]
8277-
is determined by the font rendering system,
8278-
and beyond the scope of this specification.
8278+
prevent them from overlapping adjacent content.
8279+
The actual extent of [=ink overflow=] is determined by the font rendering system,
8280+
and is beyond the scope of this specification.
82798281

82808282
However, any two conforming browser implementations,
82818283
when rendering a given piece of text content
82828284
using a given font in a supported format
82838285
(see [[css-fonts-4#font-format-definitions]]),
82848286
will produce identically-sized [=ink overflow rectangles=],
8285-
within a 2-pixel margin of error.
8286-
8287-
A practical way to prevent [=hanging glyphs=] from
8287+
within a 2-pixel margin of error. For a known font,
8288+
a practical way to prevent glyph [=ink overflow=] from
82888289
overlapping adjacent content is to load the target
82898290
content in any conforming web browser, gauge the extent
8290-
of [=ink overflow=] from [=hanging glyphs=] via visual inspection,
8291+
of [=ink overflow=] via visual inspection,
82918292
and adjust padding/margin lengths to avoid overlap, plus
82928293
an extra two pixels to allow for variations between implementations.
8293-
This should be sufficient to prevent unwanted overlap in all
8294-
conforming implementations without the necessity of testing
8295-
each implementation individually.
82968294

8295+
Note that there are many factors that may cause the glyph rendering subsystem
8296+
to use a font other than the one specified in stylesheets when drawing text,
8297+
including but not limited to UA settings, accessibility features,
8298+
and the availability of web fonts.
8299+
The extent of [=ink overflow=] derives from the actual font used for rendering text,
8300+
and developers should allow for the possibility that
8301+
the actual rendered extent of [=ink overflow=] from text
8302+
does not match what they measured during development.
82978303

82988304
<h2 id="priv" class="no-num">
82998305
Privacy Considerations</h2>

0 commit comments

Comments
 (0)