Skip to content

Commit

Permalink
[css-text-3] Add examples of reasonable, unreasonable, and impossible…
Browse files Browse the repository at this point in the history
… shaping across formatting changes. #698
  • Loading branch information
fantasai committed Oct 15, 2018
1 parent 5b26dfb commit dfa85aa
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions css-text-3/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2125,6 +2125,41 @@ Cursive Scripts</h4>
Text shaping <em>should not</em> be broken across inline box boundaries otherwise,
if it is reasonable and possible for that case given the limitations of the font technology.

<div class="example">
An example of reasonable and possible shaping across boundaries
is Arabic shaping:
in many systems this is performed by the font engine,
allowing the font to provide variant glyphs
with potentially very sophisticated contextual shaping.
It's not generally possible to rely on this system across a font change
unless the font engine has an API to provide context,
but it is straightforward and therefore quite reasonable
for an engine to work around this limitation by, for example,
using the zero-width-joiner (U+200D) or zero-width-non-joiner (U+200C)
as appropriate to solicit the correct choice of
initial/medial/final/isolated glyph.

An example of possible but not reasonable shaping across boundaries
is handling a font that is sensitive to 20 characters of context
on either side to choose its glyphs:
passing all the text before <em>and after</em> the string in question,
even through multiple inline boundaries with formatting changes,
is complicated.
The UA <em>could</em> handle such cases,
but is not required to,
as they are not typical or fundamentally required
by any modern writing system.

An example of impossible shaping accross boundaries
is a change in font weight partway through the word “and”
in a font where a ligature would replace
all three letters of the word “and”
with an ampersand glyph (“&amp;”).
<!--
It's simply not possible for the UA
to create the effect of a partway-bold single glyph.
-->
</div>

<h2 id="edge-effects">
Edge Effects</h2>
Expand Down

0 comments on commit dfa85aa

Please sign in to comment.