Skip to content

Commit e93765e

Browse files
fantasaijakearchibald
authored andcommitted
[css-text-4][css-ruby-1] Define 'text-justify: ruby' to handle default ruby space distribution w3c#771 w3c#779
1 parent 2b714a6 commit e93765e

File tree

2 files changed

+40
-10
lines changed

2 files changed

+40
-10
lines changed

css-ruby-1/Overview.bs

+22-9
Original file line numberDiff line numberDiff line change
@@ -1748,22 +1748,24 @@ Ruby Text Distribution: the 'ruby-align' property</h3>
17481748
-->
17491749

17501750
<div class="example">
1751-
Since a typical implementation will by default define [=justification opportunities=]
1751+
The [[#default-ua-ruby|default UA style sheet]] applies
1752+
''text-justify: ruby'' to [=ruby annotations=],
1753+
defining [=justification opportunities=]
17521754
between every adjacent pair of CJK [=characters=]
1753-
but not between adjacent pairs of Latin [=characters=],
1754-
the ''space-around'' and ''space-between'' values
1755-
will nevertheless result in narrow characters centered:
1755+
but not between adjacent pairs of Latin or Bopomofo [=characters=].
1756+
Thus, the ''space-around'' and ''space-between'' values
1757+
will nevertheless result in Latin or Bopomofo characters centered:
17561758
<div class="figure">
17571759
<img width="145" height="91"
17581760
alt="Diagram of glyph layout in auto aligned ruby when halfwidth ruby text is shorter than base"
17591761
src="images/ra-c-h.gif" >
17601762
<img width="145" height="91"
17611763
alt="Diagram of character layout in auto aligned ruby when ruby text is longer than narrow-width base"
17621764
src="images/ra-c-rb-h.gif" >
1763-
<p class="caption">Narrow-width ruby text in ''ruby-align/space-around'' and ''ruby-align/space-between'' ruby distribution are centered
1765+
<p class="caption">Non-CJK ruby text in ''ruby-align/space-around'' and ''ruby-align/space-between'' ruby distribution are centered
17641766
</div>
17651767

1766-
The distribution of space can be further controlled via 'text-justify'. [[CSS-TEXT-3]]
1768+
The distribution of space can be controlled via 'text-justify'. [[CSS-TEXT-3]]
17671769
</div>
17681770

17691771
Content in [=ruby bases=] and [=ruby annotations=],
@@ -2082,8 +2084,9 @@ Appendix A: Sample Style Sheets</h2>
20822084
ruby, rb, rt, rbc, rtc { unicode-bidi: isolate; }
20832085

20842086
rtc, rt {
2085-
font-variant-east-asian: ruby; /* See [[CSS3-FONTS]] */
2086-
text-emphasis: none; /* See [[CSS3-TEXT-DECOR]] */
2087+
font-variant-east-asian: ruby; /* See [[CSS-FONTS-3]] */
2088+
text-justify: ruby; /* See [[CSS-TEXT-4]] */
2089+
text-emphasis: none; /* See [[CSS-TEXT-DECOR-3]] */
20872090
white-space: nowrap;
20882091
line-height: 1; }
20892092

@@ -2155,7 +2158,7 @@ Glossary</h2>
21552158
<dl>
21562159
<dt id="g-bopomofo"><dfn noexport>Bopomofo</dfn> or <dfn noexport>Zhuyin Fuhao</dfn> (Chinese: <span lang=zh-Bopo>ㄅㄆㄇㄈ</span>, <span lang=zh-Hant>注音符號</span>, or <span lang=zh-Hans>注音符号</span>)
21572160
<dd>
2158-
<p>37 characters and 4 tone markings used as phonetics in Chinese,
2161+
<p>Characters and tone markings developed for use as phonetics in Chinese,
21592162
especially standard Mandarin.
21602163
These are often, but not exclusively, used for ruby annotations.
21612164

@@ -2182,6 +2185,13 @@ Glossary</h2>
21822185
whether the text occurs in ruby annotations or as normal inline content.
21832186
Such glyph placement is not a function of CSS ruby layout.
21842187

2188+
Bopomofo [=letters=] belong to the <code>Bopomofo</code> [=Unicode script=]
2189+
(and are currently mapped in the U+3100–312F and U+31A0–31BF blocks);
2190+
the [=Bopomofo tone marks=] are
2191+
U+02C9 (ˉ), U+02CA (ˊ), U+02C7 (ˇ), U+02CB (ˋ), U+02EA (˪), U+02EB (˫), U+02D9 (˙).
2192+
Collectively these are all considered <dfn export>Bopomofo characters</dfn>
2193+
for the purpose of CSS.
2194+
21852195
<dt id="g-hanja">Hanja (Korean: <span lang=ko>漢字</span>)
21862196
<dd>
21872197
Subset of the Korean writing system that utilizes ideographic
@@ -2265,6 +2275,9 @@ Changes since the 2 December 2021 WD</h3>
22652275
<li>Made the computed-value adjustement of 'writing-mode' on [=inter-character annotations=]
22662276
apply to the [=ruby annotation box=] rather than the [=ruby annotation container box=].
22672277
<li>Added <code>zh-Hant</code> to rule applying ''font-size: 30%'' to [=ruby annotations=] in HTML.
2278+
<li>Added <code>text-justify: ruby</code> to the UA default style sheet.
2279+
(<a href="https://github.com/w3c/csswg-drafts/issues/771">Issue 771</a>
2280+
<a href="https://github.com/w3c/csswg-drafts/issues/779">Issue 779</a>)
22682281
</ul>
22692282

22702283
<h3 id="changes-20200429">

css-text-4/Overview.bs

+18-1
Original file line numberDiff line numberDiff line change
@@ -6928,6 +6928,16 @@ Justification Method: the 'text-justify' property</h3>
69286928
<wpt pathprefix="/css/css-text/text-justify/">
69296929
text-justify-distribute-001.html
69306930
</wpt>
6931+
6932+
<dt><dfn>ruby</dfn>
6933+
<dd>
6934+
Justification adjusts spacing as for ''text-justify/auto'' <em>except</em>:
6935+
* [=Justification opportunities=] are disabled at [=word separators=].
6936+
* [=Justification opportunities=] are disabled between [=Bopomofo characters=]
6937+
6938+
Note: This value is intended for use in [=ruby annotations=],
6939+
providing a reasonable default alignment.
6940+
See [[CSS-RUBY-1]].
69316941
</dl>
69326942

69336943
<p class="advisement">
@@ -10210,7 +10220,14 @@ Acknowledgements</h2>
1021010220
<h2 class="no-num" id="changes">
1021110221
Changes</h2>
1021210222

10213-
Significant since the <a href="https://www.w3.org/TR/2019/WD-css-text-4-20191113/">2019 Working Draft</a> publication include:
10223+
Significant changes since the <a href="https://www.w3.org/TR/2022/WD-css-text-4-20220505/">5 May 2022 Working Draft</a> include:
10224+
<ul>
10225+
<li>Added ''text-justify/ruby'' value to 'text-justify'.
10226+
(<a href="https://github.com/w3c/csswg-drafts/issues/771">Issue 771</a>
10227+
<a href="https://github.com/w3c/csswg-drafts/issues/779">Issue 779</a>)
10228+
</ul>
10229+
10230+
Significant changes since the <a href="https://www.w3.org/TR/2019/WD-css-text-4-20191113/">2019 Working Draft</a> include:
1021410231
<ul>
1021510232
<li>Integrating the full text of [[CSS-TEXT-3]].
1021610233
<li>Adding percentages to 'word-spacing' and 'letter-spacing'

0 commit comments

Comments
 (0)