-
Notifications
You must be signed in to change notification settings - Fork 708
/
Copy pathOverview.html
1362 lines (1182 loc) · 69 KB
/
Overview.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>CSS3 Ruby Module</title>
<style type="text/css">
dt {font-weight: normal}
/*.issue, .note {font-style: italic}*/
.figure {font-size: smaller;}
span.note-label {font-weight: bolder;}
/* Stolen from CSS2 Recommendation */
DIV.propdef TH {
text-align: right;
}
A.propdef-title {
background: yellow;
}
DIV.propdef {margin: 1.2em 0}
A.noxref:link, A.noxref:visited {color: black; /*color: inherit*/}
</style>
<style media="print" type="text/css">
img#edge { width: 80%; height: 70%;}dt.label { display: run-in; }
</style>
<link href="default.css" rel="stylesheet" type="text/css" />
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED" rel="stylesheet" type="text/css" />
<style type="text/css">
ins {
background-color: #99FF99;
text-decoration: none;
}
del {
display: inline;
color: silver;
}
.issue { color: #F00; }
.issuehead { background-color:#FF9; }
</style>
</head>
<body>
<div class="head">
<p><a href="http://www.w3.org/"><img alt="W3C" src="http://www.w3.org/Icons/w3c_home" height="48" width="72" /></a></p>
<h1>CSS3 Ruby Module</h1>
<h2 class="no-num no-toc" id="w3c-working">W3C Working Draft 03 December 2010 (Editor's copy)</h2>
<dl>
<dt>This version:</dt>
<dd><a
href="http://dev.w3.org/csswg/css3-ruby/">http://dev.w3.org/csswg/css3-ruby/</a></dd>
<dt>Latest version:</dt>
<dd><a
href="http://www.w3.org/TR/css3-ruby">http://www.w3.org/TR/css3-ruby</a></dd>
<dt>Previous version:</dt>
<dd><a
href="http://www.w3.org/TR/2003/CR-css3-ruby-20030514">http://www.w3.org/TR/2003/CR-css3-ruby-20030514</a></dd>
<dt>Editors:</dt>
<dd><a href="mailto:rishida@w3.org">Richard Ishida (W3C)</a></dd>
<dt>Former editors:</dt>
<dd><a href="mailto:paulnel@microsoft.com">Paul Nelson (Microsoft)</a></dd>
<dd><a href="mailto:michelsu@microsoft.com">Michel Suignard (Microsoft)</a></dd>
<dd><a href="mailto:marcins@microsoft.com">Marcin Sawicki (Microsoft)</a></dd>
</dl>
<p class="copyright"><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">
Copyright</a> © 2010 <a href="http://www.w3.org/"><abbr
title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
href="http://www.lcs.mit.edu/"><abbr title="Massachusetts Institute of
Technology">MIT</abbr></a>, <a
href="http://www.ercim.eu/"><acronym title="European Research
Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a
href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>,
<a
href="http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> and <a
href="http://www.w3.org/Consortium/Legal/copyright-software">software
licensing</a> rules apply.</p>
</div>
<hr />
<h2><a id="Abstract">Abstract</a></h2>
<p>"Ruby" are short runs of text alongside the base text, typically
used in East Asian documents to indicate pronunciation or to provide a
short annotation. This document proposes a set of CSS properties
associated with the 'Ruby' elements. They can be used in combination
with the Ruby elements of HTML [<a href="#ruby">RUBY</a>].</p>
<h2><a id="Status">Status of This Document</a></h2>
<p class="issue">Text marked as an "<span class="issuehead">Issue</span>" and any change-marked text all indicate proposals that are currently awaiting or under discussion. All such text is subject to modification or removal. Once it is felt that the proposal is acceptable, the change marks will be removed.</p>
<p class="issue">See <a href="http://www.w3.org/Style/CSS/Tracker/products/25"> open issues in
Tracker.</a></p>
<p><strong style=""><ins>This document is an editors' copy that has no official standing.</ins></strong></p>
<p><ins><em>This section describes the status of this document at the time of
its publication. Other documents may supersede this document. A list of
current W3C publications and the latest revision of this technical report
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
index at http://www.w3.org/TR/.</a></em></ins></p>
<p><ins>Publication as a Working Draft does not imply endorsement by the W3C
Membership. This is a draft document and may be updated, replaced or
obsoleted by other documents at any time. It is inappropriate to cite
this document as other than work in progress.</ins></p>
<p><ins>The (<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
public mailing list <a href="mailto:www-style@w3.org">www-style@w3.org</a> (see <a href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
discussion of this specification. When sending e-mail, please put the
text “css3-ruby” in the subject, preferably like this:
“[<!---->css3-ruby<!---->] <em>…summary of comment…</em>”</ins></p>
<p><ins>This document was produced by the <a href="/Style/CSS/members">CSS
Working Group</a> (part of the <a href="/Style/">Style Activity</a>).</ins></p>
<p><ins>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
2004 W3C Patent Policy</a>. W3C maintains a <a href="/Style/CSS/Disclosures" rel="disclosure">public list of any patent
disclosures</a> made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent. An
individual who has actual knowledge of a patent which the individual
believes contains <a href="/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a href="/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of
the W3C Patent Policy</a>.</ins></p>
<!--end-status-->
<p><ins>This document contains the <abbr title="Cascading Style
Sheets">CSS3</abbr> Ruby Module W3C <a href="http://www.w3.org/2005/10/Process-20051014/tr.html#RecsWD"> Working
Draft</a> of 3 February 2010.</ins></p>
<p><ins>The comments that the CSS WG received during the previous Last Call review,
together with responses and resulting changes are listed in the <a
href="/Style/2003/css3-ruby-last-call">disposition of comments.</a></ins></p>
<p><del>This specification is one of the CSS level "modules".`It has been developed
by the CSS Working Group which is
part of the <a href="http://www.w3.org/Style/">Style activity</a> (see
<a href="http://www.w3.org/Style/Activity">summary</a>). It contains
features to be included for CSS level 3.</del></p>
<p><del>This is a <a href="/TR/#About">Candidate Recommendation,</a> which
means W3C believes the specification is ready to be implemented.
</del></p>
<p><del>All persons are encouraged to review and implement this
specification and send comments to the (<a href=
"http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a href="mailto:www-style@w3.org">www-style</a> (see <a
href="http://www.w3.org/Mail/Request">instructions</a>). W3C Members
can also send comments directly to the CSS Working Group.</del></p>
<p><del>For this specification to become a W3C Recommendation, the
following criteria must be met</del>:</p>
<ol>
<li><p><del>There must be at least two interoperable implementations for
every feature in the specification.</del></p>
<p><del>For the purposes of this criterion, we define the following
terms:</del></p>
<dl>
<dt><del>feature</del> </dt>
<dd><del>a section or subsection in the specification</del></dd>
<dt><del>interoperable</del> </dt>
<dd><del>passing the respective test case(s) in the test suite, or, if
the implementation is not a web browser, an equivalent test. Every
relevant test in the test suite should have an equivalent test
created if such a user agent (UA) is to be used to claim
interoperability. In addition if such a UA is to be used to claim
interoperability, then there must one or more additional UAs which
can also pass those equivalent tests in the same way for the
purpose of interoperability. The equivalent tests must be made
publically available for the purposes of peer review.</del></dd>
<dt><del>implementation</del> </dt>
<dd><p><del>a user agent which:</del></p>
<ol>
<li><del>implements the feature.</del></li>
<li><del>is available (i.e. publicly downloadable or available
through some other public point of sale mechanism). This is the
"show me" requirement.</del></li>
<li><del>is shipping (i.e. development, private or unofficial
versions are insufficient).</del></li>
<li><del>is not experimental (i.e. is intended for a wide audience
and could be used on a daily basis.)</del></li>
</ol></dd>
</dl></li>
<li><del>A minimum of six months of the CR period must have elapsed. This
is to ensure that enough time is given for any remaining major
errors to be caught.</del></li>
</ol>
<p><del>The comments that the CSS WG received on the last working draft,
together with responses and resulting changes are listed in the <a
href="/Style/2003/css3-ruby-last-call">disposition of comments.</a></del></p>
<p><del>Patent disclosures relevant to CSS may be found on the Working
Group's public <a href="/Style/CSS/Disclosures">patent disclosure
page.</a></del></p>
<p><del>To find the latest version of this specification, please follow the
"Latest version" link above, or visit the list of W3C <a
href="http://www.w3.org/TR/">Technical Reports</a>.</del></p>
<div class="subtoc">
<h2><a id="Contents">Contents</a></h2>
<ul class="toc">
<li class="tocline2"><a href="#dependencies" class="tocxref">1. Dependencies</a></li>
<li class="tocline2"><a href="#introduction" class="tocxref">2. Introduction</a>
<ul class="toc">
<li class="tocline3"><a href="#conventions" class="tocxref">2.1 Document conventions</a></li>
<li class="tocline3"><a href="#ruby-def" class="tocxref">2.2 What is ruby?</a></li>
</ul>
</li>
<li class="tocline2"><a href="#css-model" class="tocxref">3. The CSS ruby model</a>
<ul class="toc">
<li class="tocline3"><a href="#display" class="tocxref">3.1 Ruby specific 'display' property values</a></li>
<li class="tocline3"><a href="#box-model" class="tocxref">3.2 Ruby box model</a></li>
<li class="tocline3"><a href="#ruby-line-height" class="tocxref">3.3 Ruby box and line
stacking</a></li>
<li class="tocline3"><a href="#ruby-line-breaking" class="tocxref">3.4 Ruby box and line
breaking</a></li>
</ul>
</li>
<li class="tocline2"><a href="#ruby-props" class="tocxref">4. Ruby Properties</a>
<ul class="toc">
<li class="tocline3"><a href="#rubypos" class="tocxref">4.1 Ruby
positioning: the 'ruby-position' property</a></li>
<li class="tocline3"><a href="#rubyalign" class="tocxref">4.2 Ruby
alignment: the 'ruby-align' property</a></li>
<li class="tocline3"><a href="#rubyover" class="tocxref">4.3 Ruby
overhanging: the 'ruby-overhang' property</a></li>
<li class="tocline3"><a href="#rubyspan" class="tocxref">4.4 Ruby
annotation spanning: the 'ruby-span' property</a></li>
</ul>
</li>
<li class="tocline2"><a href="#properties" class="tocxref">5. Properties index</a></li>
<li class="tocline2"><a href="#profiles" class="tocxref">6. Profiles</a></li>
<li class="tocline2"><a href="#glossary" class="tocxref">Glossary</a></li>
<li class="tocline2"><a href="#ack" class="tocxref">Acknowledgements</a></li>
<li class="tocline2"><a href="#references" class="tocxref">References</a></li>
</ul>
</div>
<hr />
<h2><a id="dependencies">1. Dependencies on other modules</a></h2>
<p>This CSS3 module depends on the following other CSS3 modules:</p>
<ul>
<li>Text</li>
<li>Line</li>
<li>Syntax</li>
<li>Values and units</li>
</ul>
<p class="issue"><span class="issuehead">Issue: </span> Check these dependencies are correct.</p>
<h2><a id="introduction">2. Introduction</a></h2>
<h3><a id="conventions">2.1 Document conventions</a></h3>
<p>There <del>is</del><ins>are</ins> a number of illustrations in this document for which the following
legend is used:</p>
<p><img alt="Symbolic wide-cell glyph representation" class="example"
width="39" height="39" src="images/fullwidth.gif" /> - wide-cell glyph (e.g. Han)
which is the <i>n</i>-th character in the text run, they may also appear as
half size boxes when used as annotations.<br />
<img alt="Symbolic narrow-cell glyph representation" class="example"
width="19" height="39" src="images/halfwidth.gif" /> - narrow-cell glyph (e.g. Roman)
which is the <i>n</i>-th glyph in the text run.<br />
</p>
<p>Many typographical properties in East Asian typography depend on the fact
that a character is typically rendered as either a wide or narrow character. All
characters described by the Unicode Standard <a href="#UNICODE">[UNICODE]</a> can be categorized by a
width property. This is covered by the Unicode Standard Annex
<a href="#UAX11">[UAX#11]</a>. </p>
<p>The orientation which the above symbols assume in the diagrams corresponds
to the orientation that the glyphs they represent are intended to assume when
rendered by the user agent. Spacing between these characters in the diagrams is
usually symbolic, unless intentionally changed to make a point.</p>
<p>Finally, in this document, requirements are expressed using the key words
"MUST", "MUST NOT", "REQUIRED", "SHALL" and "SHALL NOT". Recommendations are
expressed using the key words "SHOULD", "SHOULD NOT" and "RECOMMENDED". "MAY"
and "OPTIONAL" are used to indicate optional features or behavior. These
keywords are used in accordance with <a href="#rfc2119">[RFC 2119]</a>. For
legibility these keywords are used in lowercase form.</p>
<h3><a id="ruby-def">2.2 What is ruby?</a></h3>
<p>"Ruby" is the commonly used name for a run of text that appears in the
immediate vicinity of another run of text, referred to as the "base", and
serves as an annotation or a pronunciation guide associated with that run of
text. Ruby, as used in Japanese, is described in JIS X-4051 [<a
href="#jis4051">JIS4051</a>]<ins> (in Japanese) and in Requirements for Japanese Text Layout [<a href="#jlreq">JLREQ</a>] (in English and Japanese)</ins>]. The ruby structure and the XHTML markup to represent it
is described in the Ruby Annotation [<a href="#ruby">RUBY</a>] specification. This
section describes the CSS properties relevant to ruby. The following figures
show two examples of Ruby.</p>
<div class="figure">
<p>
<img alt="Example of ruby applied on top of a Japanese expression"
class="example" src="images/licence.png" /></p>
<p><b>Figure 2.2.1</b>: Example of ruby used in Japanese (simple case)</p>
</div>
<div class="figure">
<p>
<img
alt="Example showing complex ruby with annotation text before and after
the base characters"
class="example" src="images/ruby-univ.gif" width="277" height="108" /></p>
<p><strong>Figure 2.2.2</strong>: Complex ruby with annotation text before and after
the base characters</p>
</div>
<p>In the first example, a single annotation is used to annotate the base
sequence. In Japanese typography, this simple case is sometimes called "<span lang="ja">taigo</span> ruby"<ins> or group-ruby </ins> (per-word ruby).</p>
<p>In the second example, multiple annotations are attached to a base
sequence, the hiragana characters on top refer to the pronunciation of each of the
base Kanji characters (annotated in a <a href="#g-monoruby">mono-ruby</a> fashion), while the words 'Keio'
and 'University' on the bottom are
annotations describing the English translation of respectively the first four
and the last two Kanji characters
of the base. To allow correct association between the hiragana characters and
their corresponding Kanji base characters, the spacing between these Kanji
characters may be adjusted (this happens <del>to</del><ins>around</ins> the fourth Kanji character in the
figure 2.<del>1</del><ins>2</ins>.2 above).</p>
<p class="Note"><span class="note-label">Note:</span> To avoid variable spacing between the Kanji
characters in the example above the hiragana annotations can also be created as
a simple annotation ruby.</p>
<p>The two examples correspond respectively to two types of ruby: <del>a </del>simple ruby using <del>a</del> simple ruby markup and <del>a </del>complex ruby using <del>a</del> complex ruby
markup.</p>
<h2><a id="css-model">3. The CSS ruby model</a></h2>
<h3 id="display">3.1 Ruby specific 'display' property values</h3>
<p>The CSS ruby model is based on the W3C Ruby Annotation Recommendation
[<a href="#ruby">RUBY</a>], which is consistent with the XHTML Modularization
Framework [<a href="#xhtml-mod">XHTMLMOD</a>]. The Recommendation specifies the ruby structure in a way
to closely parallel
the visual layout of the ruby element. In this model, a ruby consists of one
or more base elements associated with one or more annotation elements.</p>
<p>The CSS model does not require that the document language include elements
that correspond to each of these components. For document languages (such as
XML applications) that do not have pre-defined ruby elements, authors must map
document language elements to ruby elements; this is done with the 'display'
property. The following 'display' values assign ruby semantics to an arbitrary
element:</p>
<dl>
<dt><strong>ruby</strong> (in XHTML: ruby)</dt>
<dd>Specifies that an element defines a ruby structure.</dd>
<dt><strong>ruby-base</strong> (in XHTML: rb)</dt>
<dd>Specifies that an element defines a ruby base.</dd>
<dt><strong>ruby-text</strong> (in XHTML: rt)</dt>
<dd>Specifies that an element defines a ruby text.</dd>
<dt><strong>ruby-base-container</strong> (in XHTML: rbc)</dt>
<dd>Specifies that an element contains one or more ruby base.</dd>
<dt><strong>ruby-text-container</strong> (in XHTML: rtc)</dt>
<dd>Specifies that an element contains one or more ruby text.</dd>
</dl>
<p class="issue"><span class="issuehead">Issue: </span> I18n WG proposes that there should be a display value rp also, to allow XML-based formats to associate rp behaviour with elements. See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=[CSS3+Ruby]%20display:+rp+value&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&index-grp=Member__FULL+Public__FULL&index-type=t&type-index=public-i18n-core%40w3.org&resultsperpage=20&sortby=date">thread</a>.</p>
<p>The <a
href="http://www.w3.org/TR/ruby/#ruby"><samp>rbspan</samp></a> attribute should
also be used by XML applications to allow annotation spanning; but in addition, the
'<a href="#ruby-span">ruby-span</a>' property must be used by those applications to indicate to the user agent the number of
ruby base elements to be spanned.</p>
<h3><a id="box-model">3.2 Ruby box model</a></h3>
<p class="issue"><span class="issuehead">Issue: </span> The spec needs to address anonymous box generation rules (and to make them compatible with HTML5 ruby markup).</p>
<p>In the following description, the elements specified by Ruby
Annotation [<a href="#ruby">RUBY</a>] are used to describe the box model. As mentioned
earlier, a user agent can obtain the same results by using the Ruby specific 'display'
property values. </p>
<p>For a user agent that supports the ruby markup, the ruby structure consists of three or more
boxes. The outermost container is the <a
href="http://www.w3.org/TR/ruby/#ruby"><samp>ruby</samp></a> element itself.
In the simple case, it is a container for two non-overlapping boxes: the ruby
text box (<a href="http://www.w3.org/TR/ruby/#rt"><samp>rt</samp></a> element)
and the ruby base box (<a
href="http://www.w3.org/TR/ruby/#rb"><samp>rb</samp></a> element). The
positioning of these two boxes relative to each other is controlled by the <a
href="#rubypos">'ruby-position'</a> property.</p>
<div class="figure">
<img class="example" width="223" height="93"
alt="Diagram of the ruby box model consisting of two boxes, one on top of the other, enclosed within a third box representing the ruby element"
src="images/r-box-t.gif" />
<p><b>Figure 3.2.1</b>: Ruby box model (simple case)</p>
</div>
<p>In the case of complex ruby, the ruby element is a container for two or
three non-overlapping boxes: one ruby base collection (<a
href="http://www.w3.org/TR/ruby/#rbc"><samp>rbc</samp></a> element), and one
or two ruby text collections (<a
href="http://www.w3.org/TR/ruby/#rtc"><samp>rtc</samp></a> element). The
<samp>rbc</samp> element is itself a container for one or several ruby base
box (<samp>rb</samp> element), while each <samp>rtc</samp> element is a
container for one or several ruby text box (rt element). The position of the
<samp>rtc</samp> element in relation to the related <samp>rbc</samp> element
is controlled by the <a href="#rubypos">'ruby-position'</a> property. The two
following figures show examples of these complex ruby.</p>
<div class="figure">
<img src="images/r-box-g.gif"
alt="Diagram of a group ruby with a full ruby text above and partial ruby text below" width="408" height="170" />
<p><b>Figure 3.2.2</b>: Ruby box model (complex ruby with an empty rt element
after)</p>
</div>
<p>In the example above, the ruby text after (below) the ruby bases contains two <samp>rt</samp> elements with the first one
being empty, the empty <samp>rt</samp> element corresponds to the first part
of the ruby base collection (the first part is identified by the first <samp>rb</samp> element
within the <samp> rbc</samp> element).</p>
<div class="figure">
<img src="images/r-box-h.gif"
alt="Diagram of a group ruby with a spanning ruby text above and partial ruby text below" width="400" height="173" />
<p><b>Figure 3.2.3</b>: Ruby box model (complex ruby with a spanning ruby text
element)</p>
</div>
<p>In the example above, the ruby text before (above) the ruby bases spans the whole ruby base collection. The
ruby text after (below) the ruby bases still contain two <samp>rt</samp> elements, one of
which is empty. The spanning behavior of <samp>rt</samp> text elements is
controlled by the <a
href="http://www.w3.org/TR/ruby/#ruby"><samp>rbspan</samp></a> attribute in a
way similar to the <samp>colspan</samp> attribute used for table column.</p>
<p class="issue"><span class="issuehead">Issue: </span> The examples above contain the term 'group ruby', which is not used elsewhere in this specification. It appears to be used in a way that is different to the use of the term in JLREQ. I propose to replace it with just 'ruby'.</p>
<p class="note"><span class="note-label">Note:</span> The visual description of the ruby elements does not refer
necessarily to the logical orders of the elements</p>
<p>The width of the ruby box is by default determined by its widest child
element, whose width in turn is determined by its content. The width of all direct
children of the <samp>ruby</samp> element is the width of the widest children. In this respect, the ruby
box is much like a two or three row <samp>table</samp> element, with the
following exceptions:</p>
<ul>
<li>the ruby box is an inline element, like an image, even though it itself,
like a table, is a container of other boxes</li>
<li>the equivalent of the cells: the <samp>rb</samp> element and the
<samp>rt</samp> text element can only contain inline-level elements.</li>
<li>the content of each 'cell' is always measured at its maximum width</li>
<li>unlike a table, a ruby element doesn't have to fit in a line, the ruby
box may be split into several boxes at line boundary, depending of the
spanning of the ruby texts. This is however only possible for the complex
ruby and can only happen at the boundary of non spanning elements.</li>
<li>both the ruby text and the ruby base boxes may overlap with adjacent
text (outside of the ruby element) if an appropriate <a
href="#rubyover">'ruby-overhang'</a> parameter is set via CSS. Note
however that the actual content of the ruby base cannot overlap with that
adjacent text. The distribution of the content of the ruby base within the
ruby base box is controlled by the <a href="#rubyalign">'ruby-align'</a>
property.</li>
</ul>
<p>If the ruby text is not allowed to overhang, then the ruby behaves like a
traditional box, i.e. only its contents are rendered within its boundaries and
adjacent elements do not cross the box boundary:</p>
<div class="figure">
<p><img class="example" width="220" height="91"
alt="Diagram showing the ruby boxes interacting with adjacent text"
src="images/ro-n.gif" /></p>
<p><b>Figure 3.2.4</b>: Simple ruby whose text is not allowed to overhang
adjacent text</p>
</div>
<p>However, if ruby text is allowed to overhang adjacent elements and it
happens to be wider than its base, then the adjacent content is partially
rendered within the area of the ruby base box, while the ruby text may be
partially overlapping with the upper blank parts of the adjacent content:</p>
<div class="figure">
<p><img class="example" width="177" height="91"
alt="Diagram showing the ruby boxes interacting with adjacent text"
src="images/ro-a.gif" /></p>
<p><b>Figure 3.2.5</b>: Simple ruby whose text is allowed to overhang adjacent
text</p>
</div>
<p>The ruby text related to a ruby base can never overhang another ruby
base.</p>
<p>The alignment of the contents of the base or the ruby text is not affected
by the overhanging behavior. The alignment is achieved the same way regardless
of the overhang behavior setting and it is computed before the space available
for overlap is determined. It is controlled by the <a
href="#rubyalign">'ruby-align'</a> property.</p>
<p>The exact circumstances in which the ruby text will overhang other
elements, and to what degree it will do so, will be controlled by the <a
href="#rubyover">'ruby-overhang'</a> property.</p>
<p>This entire logic applies the same way in vertical ideographic layout, only
the dimension in which it works in such a layout is vertical, instead of
horizontal.</p>
<p class="note"><span class="note-label">Note:</span> Because the purpose of the XHTML <samp>rp</samp> element [<a
href="#ruby">RUBY</a>] is to allow pre-existing user agents
to parenthesize ruby text content, an XHTML user agent should use a styling rule
for these elements that avoids rendering them such as <samp>rp {display:
none}</samp>.</p>
<h3><a id="ruby-line-height">3.3 Ruby box and line stacking</a></h3>
<p>The interaction of the ruby box and line stacking is controlled by the
'line-stacking-ruby' property described in the CSS3 Line Module. That property
takes two values: 'include-ruby' and 'exclude-ruby. Depending on the property
value, the ruby box is considered or excluded for line stacking. Even if the
ruby box is considered for line stacking, some values of the
'line-stacking-strategy' property (also described in the CSS3 Line module) can
still create occurrences where a the ruby box will eventually be ignored (e.g.
case where the 'line-stacking-strategy' value is 'block-line-height').</p>
<p>In the following figure, each line box is shown with leading space
distributed before and after the two text segments ('Previous line' and 'Ruby
base'); the dotted lines show the line box for each line. The
'line-stacking-ruby' property is set to 'exclude-ruby'. The achieved effect is
that the ruby box does not affect the line to line spacing. It is however the
responsibility of the style author to avoid 'bleeding' effects between the ruby
text and the surrounding text of images.</p>
<div class="figure">
<p>
<img class="example"
alt="Diagram showing the ruby text using 2 half leading"
src="images/rlh-a.gif" width="210" height="138" /></p>
<p><b>Figure 3.3.1</b>: Excluded Ruby text</p>
</div>
<p>In the following figure, the line boxes have no extra leading space. The
'line-stacking-ruby' property is set to 'include-ruby' and the
'line-stacking-strategy' property is set to a value where inline boxes are
considered for line stacking. In this case, the line box with
the ruby text is affected and has its 'stack-height' increased by the amount
necessary to fit the ruby text.</p>
<div class="figure">
<p>
<img class="example"
alt="Diagram showing the ruby text expanding above base text"
src="images/rlh-b.gif" width="210" height="111" /></p>
<p><b>Figure 3.3.2</b>: Ruby text increasing line height</p>
</div>
<p>This mechanism allows rendering of evenly spaced lines of text within a
block-level element, whether a line contains ruby or not. The authors need
only to set for the block-level element a line height value larger than the
computed line-height of the largest ruby element within the block.</p>
<h3><a id="ruby-line-breaking">3.4 Ruby box and line breaking</a></h3>
<p>When a ruby falls at the end of a line where there is not sufficient room for the entire ruby to fit on the line, the complex ruby may be broken at locations where boxes of the ruby container align. Some examples are provided below to provide more clarity.</p>
<p>
<img class="example"
alt="Diagram showing the line breaking opportunity in a complex ruby"
src="images/r-break-a.gif" width="408" height="201" /></p>
<p><b>Figure 3.4.1</b>: Complex ruby line breaking opportunity</p>
<p>
<img class="example"
alt='Diagram showing the line breaking opportunity in a "Bopomofo" ruby'
src="images/r-break-b.gif" width="300" height="90" /></p>
<p><b>Figure 3.4.1</b>: "Bopomofo" ruby line breaking opportunity</p>
<p class="issue"><span class="issuehead">Issue: </span> Line breaks should only be allowed within ruby if the ruby base text can be broken at that point. E.g. if complex Ruby is used to annotate the two morphemes of "butterfly", the fact that we have added ruby annotations should not cause a line breaking opportunity to be present between "butter" and "fly" </p>
<h2><a id="ruby-props">4. Ruby Properties</a></h2>
<p>All properties, in addition to the noted values, take 'initial' and
'inherit'. These values are not repeated in each of the property value
enumeration. </p>
<h3><a id="rubypos"></a>4.1 Ruby positioning: the <a href="#ruby-position">'ruby-position'</a> property</h3>
<table class="propdef" cellspacing="0" cellpadding="0">
<tbody>
<tr align="left"><th>Name:</th><th id="ruby-position">ruby-position</th></tr>
<tr>
<td><em>Value:</em></td>
<td>before | after | <del>right</del><ins>bopomofo</ins><ins> | inline</ins></td>
</tr>
<tr>
<td><em>Initial:</em></td>
<td>before</td>
</tr>
<tr>
<td><em>Applies to:</em></td>
<td>the parent of elements with display: ruby-text.</td>
</tr>
<tr>
<td><em>Inherited:</em></td>
<td>yes</td>
</tr>
<tr>
<td><em>Percentages:</em></td>
<td>N/A</td>
</tr>
<tr>
<td><em>Media:</em></td>
<td>visual</td>
</tr>
<tr>
<td><em>Computed value: </em></td>
<td>specified value (except for initial and inherit)</td>
</tr>
</tbody>
</table>
<p class="issue"><span class="issuehead">Issue: </span> <strong>NOTE: The change marks in this section are proposals that have yet to be discussed. They do not indicate an intention on the part of the working group to adopt those edits. They are made as a baseline from which to begin discussion.</strong></p>
<p class="issue"><span class="issuehead">Issue: </span> I am proposing that we replace 'right' with 'bopomofo', since that was its original intended purpose and such removes potential ambiguity with 'inline' or 'before'. Bopomofo ruby needs special handling by the implementation, if ruby is to always appear to the right. (Note that the user may also choose to position bopomofo ruby before the base, in which case they would use the normal 'before' setting.)</p>
<p>This property is used by the parent of elements with display: ruby-text to
control the position of the ruby text with respect to its base. Such parents
are typically either the <samp>ruby</samp> element itself (simple ruby) or the
<samp>rtc</samp> element (complex ruby). This assures that all parts of a <samp>rtc</samp>
element will be displayed in the same position. Possible values:</p>
<p class="issue"><span class="issuehead">Issue-107: </span> Roland Steiner has requested the addition of an auto value as default. See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=ruby-position%3A+undesirable+default+value+%27before%27+for+complex+ruby&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&period_month=&period_year=&index-grp=Public__FULL&index-type=t&type-index=www-style&resultsperpage=20&sortby=date">this thread</a> and <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=Styling+of+complex+Ruby&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&period_month=&period_year=&index-grp=Public__FULL&index-type=t&type-index=public-i18n-core&resultsperpage=20&sortby=date">this one</a>.</p>
<dl>
<dt><strong>before</strong></dt>
<dd>The ruby text appears before the base. This is the most common setting
used in ideographic East Asian writing systems. This is the initial
value.
<div class="figure">
<p>
<img
alt="Diagram of ruby glyph layout in horizontal mode with ruby text appearing above the base"
class="example" src="images/shinkansen-top.gif" width="140" height="33" /></p>
<p><b>Figure 4.1.1</b>: Top ruby in horizontal layout applied to
Japanese text</p>
</div>
<p>If the base appears in a vertical-ideographic layout mode, the ruby
appears on the right side of the base and is rendered in the same layout
mode as the base (i.e. vertical-ideographic).</p>
<div class="figure">
<p>
<img
alt="Diagram of ruby glyph layout in vertical mode with ruby text apearing vertically on the right of the base"
class="example" src="images/shinkansen-right.gif" width="33" height="141" /></p>
<p><b>Figure 4.1.2</b>: Top ruby in vertical ideographic layout applied
to Japanese text</p>
</div>
</dd>
<dt><strong>after</strong></dt>
<dd>The ruby text appears after the base. This is a relatively rare
setting used in ideographic East Asian writing systems, most easily
found in educational text.
<div class="figure">
<p>
<img
alt="Diagram of ruby glyph layout in horizontal mode with ruby text appearing below the base"
class="example" src="images/shinkansen-bottom.gif" width="142" height="36" /></p>
<p><b>Figure 4.1.3</b>: Bottom ruby in horizontal layout applied to
Japanese text</p>
</div>
<p>If the base appears in a vertical ideographic mode, the bottom ruby
appears on the left side of the base and is rendered in the same layout
mode as the base (i.e. vertical).</p>
<div class="figure">
<p>
<img
alt="Diagram of ruby glyph layout in vertical mode with ruby text apearing vertically on the left of the base"
class="example" src="images/shinkansen-left.gif" width="37" height="141" /></p>
<p><b>Figure 4.1.4</b>: Bottom ruby in vertical ideographic layout applied
to Japanese text</p>
</div>
</dd>
<dt><strong><del>right</del><ins>bopomofo</ins></strong></dt>
<dd>
<p class="issue"><span class="issuehead">Issue: </span> I am proposing that we replace 'right' with 'bopomofo', since that was its original intended purpose and such removes potential ambiguity with 'inline' or 'before'. Bopomofo ruby needs special handling by the implementation, if ruby is to always appear to the right. (Note that the user may also choose to position bopomofo ruby before the base, in which case they would use the normal 'before' setting.) Need agreement that bopomofo is a suitable replacement for right. See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=[CSS3+Ruby]%20Vertical+layout+not+enough+for+bopomofo&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&index-grp=Member__FULL+Public__FULL&index-type=t&type-index=public-i18n-core%40w3.org&resultsperpage=20&sortby=date">this thread</a> following a request from the i18n WG.</p>
<p>The ruby text appears on the right of the base. Unlike 'before' and
'after', this value is visual and is not relative to the text flow direction.</p>
<p><del>Note the</del><ins>This value is provided for the</ins> special case of traditional Chinese as used especially in
Taiwan: ruby (made of <a href="#g-bopomofo"><span
lang="zh">bopomofo</span></a> glyphs) in that context <del>can</del> appear<ins>s vertically </ins>along
the right side of the base glyph, <del>as if the text were in vertical
layout, but the bases themselves are rendered on a horizontal line,
since the actual layout is horizontal</del><ins>whether the layout of the base characters is vertical or horizontal</ins>:</p>
<div class="figure">
<p><img alt="Example of Taiwanese-style ruby" class="example"
width="138" height="42" src="images/bopomofo.gif" /></p>
<p><b>Figure 4.1.5</b>: "<span lang="zh">Bopomofo</span>" ruby in
traditional Chinese (ruby text shown in blue for clarity) in horizontal
layout</p>
</div>
<p><del>In order to achieve that effect, vertical-ideographic layout should
be set on each individual ruby. That can be accomplished with the
following simple CSS rule:</del></p>
<pre><del>ruby.bopomofo { writing-mode: tb-rl }</del></pre>
<p class="note"><span class="note-label">Note:</span> The bopomofo
transcription is written in the normal way as part of the ruby text.
The user agent is responsible for ensuring the correct relative alignment
and positioning of the glyphs, including those corresponding to the
tone marks, when displaying<del> as vertical ruby</del>.<ins> Tone marks are spacing characters that occur in memory at the end of the ruby text for each base character. They are usually displayed in a separate column to the right of the bopomofo characters, and the height of the tone mark depends on the number of characters in the syllable. One tone mark, however, is placed above the bopomofo, not to the right of it.</ins></p>
<p class="note"><ins><span class="note-label">Note:</span> To make bopomofo annotations appear before or after the base text, like annotations for most other East Asian writing systems, use the 'before' and 'after' values of ruby-position.</ins></p>
<p><ins>It is not defined how a user-agent should handle ruby text that is not bopomofo when the value of ruby-position is set to 'right'.</ins></p>
</dd>
<dt><ins><strong>inline</strong></ins></dt>
<dd>
<p><ins>Ruby text follows the ruby base with no special styling. The value can be used to disable ruby text positioning.</ins></p>
<p><ins>If the author has used the XHTML <samp>rp</samp> element [<a href="#ruby">RUBY</a>] they should set the <samp>display</samp> value for that element to <samp>inline</samp>, so that the ruby text is distinguishable from the base text. If no <samp>rp</samp> element has been used, the author can use the <samp>content</samp> property with the <samp>:before</samp> and <samp>:after</samp> pseudo-elements to set off the ruby text. </ins></p>
<p class="issue"><span class="issuehead">Issue: </span> Here is a <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=[CSS3+Ruby]%20inline+value+description+missing&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&index-grp=Member__FULL+Public__FULL&index-type=t&type-index=public-i18n-core%40w3.org&resultsperpage=20&sortby=date">request </a>for this section to be added, from the i18n WG..</p>
</dd>
</dl>
<p>If two rtc elements are set with the same ruby-position value, (for example
both 'before'), the relative position of the two elements is undefined. This
setting should not be used.</p>
<h3>4<a id="rubyalign">.2 Ruby alignment: the 'ruby-align' property</a></h3>
<table class="propdef" cellspacing="0" cellpadding="0">
<tbody>
<tr align="left"><th>Name:</th><th id="ruby-align">ruby-align</th></tr>
<tr>
<td><em>Value:</em></td>
<td>auto | start | left | center | end | right | distribute-letter |
distribute-space | line-edge</td>
</tr>
<tr>
<td><em>Initial:</em></td>
<td>auto</td>
</tr>
<tr>
<td><em>Applies to:</em></td>
<td>all elements and generated content</td>
</tr>
<tr>
<td><em>Inherited:</em></td>
<td>yes</td>
</tr>
<tr>
<td><em>Percentages: </em></td>
<td>N/A</td>
</tr>
<tr>
<td><em>Media:</em></td>
<td>visual</td>
</tr>
<tr>
<td><em>Computed value: </em></td>
<td>specified value (except for initial and inherit)</td>
</tr>
</tbody>
</table>
<p>This property can be used on any element to control the text alignment of
the ruby text and ruby base contents relative to each other. It applies to all
the ruby<del>'</del>s in the element. For simple ruby, the alignment is applied to the
ruby child element whose content is shorter: either the <a
href="http://www.w3.org/TR/ruby/#rb"><samp>rb</samp></a> element or the <a
href="http://www.w3.org/TR/ruby/#rt"><samp>rt</samp></a> element [<a
href="#ruby">RUBY</a>]. For complex ruby, the alignment is also applied to the
ruby child elements whose content is shorter: either the <samp>rb</samp>
element and/or one or two <samp>rt</samp> elements for each related ruby text
and ruby base element within the <samp>rtc</samp> and <samp>rbc</samp>
element.</p>
<p>Possible values:</p>
<p class="issue"><span class="issuehead">Issue: </span> Tony Graham has <a href="http://www.w3.org/Style/XSL/Group/FO/wiki/Ruby#Treat_CSS3_.22ruby-align.22_As_Shorthand.3F">suggested </a>that distribute-letter and distribute-space be values of a ruby-group-distribution property, and line-edge be moved to a ruby-alignment-edge property, and that the rest be gathered under a ruby-alignment property. And that ruby-align become a shorthand.</p>
<dl>
<dt><strong>auto</strong></dt>
<dd>The user agent determines how the ruby contents are aligned. This is
the initial value. The behavior recommended by <del>[<a href="#jis4051">JIS4051</a>]</del><ins>[<a href="#jlreq">JLREQ</a>]</ins> is for <del>a</del> wide-cell ruby <del>is</del> to be aligned in the 'distribute-space' mode:
<div class="figure">
<p><img class="example" width="145" height="91"
alt="Diagram of glyph layout in auto aligned ruby when ruby text is shorter than base"
src="images/ra-ds.gif" /><img class="example" width="145" height="91"
alt="Diagram of glyph layout in auto aligned ruby when ruby text is longer than base"
src="images/ra-ds-rb.gif" /></p>
<p><b>Figure 4.2.1</b>: Wide-cell text in 'auto' ruby alignment is
'distribute-space' justified</p>
</div>
<p>The recommended behavior for <del>a</del> narrow-cell glyph ruby is to be
aligned in the 'center' mode.</p>
<div class="figure">
<p><img
alt="Diagram of glyph layout in auto aligned ruby when halfwidth ruby text is shorter than base"
class="example" width="145" height="91"
src="images/ra-c-h.gif" /><img
alt="Diagram of character layout in auto aligned ruby when ruby text is longer than narrow-width base"
class="example" width="145" height="91"
src="images/ra-c-rb-h.gif" /></p>
<p><b>Figure 4.2.2</b>: Narrow-width ruby text in 'auto' ruby alignment
is centered</p>
</div>
</dd>
<dt><strong><del>start</del></strong></dt>
<dt><strong>left</strong></dt>
<dd>The ruby text content is aligned with the start edge of the base.
<p class="issue"><span class="issuehead">Issue: </span> The i18n WG feels that start and left should not be synonymous. Can we drop left (there is no left/right in overhang)? See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=[CSS3+Ruby]%20left/start+and+right/end&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&index-grp=Member__FULL+Public__FULL&index-type=t&type-index=public-i18n-core%40w3.org&resultsperpage=20&sortby=date">this thread</a>.</p>
<div class="figure">
<p><img
alt="Diagram of glyph layout in left aligned ruby when ruby text is shorter than base"
class="example" width="145" height="91" src="images/ra-l.gif" /><img
class="example" width="145" height="91"
alt="Diagram of glyph layout in left aligned ruby when ruby text is longer than base"
src="images/ra-l-rb.gif" /></p>
<p><b>Figure 4.2.3</b>: Start ruby alignment</p>
</div>
</dd>
<dt><strong>center</strong></dt>
<dd>The ruby text content is centered within the width of the base. If the
length of the base is smaller than the length of the ruby text, then the
base is centered within the width of the ruby text.
<div class="figure">
<p><img class="example" width="145" height="91"
alt="Diagram of glyph layout in center aligned ruby when ruby text is shorter than base"
src="images/ra-c.gif" /><img class="example" width="145" height="91"
alt="Diagram of glyph layout in center aligned ruby when ruby text is longer than base"
src="images/ra-c-rb.gif" /></p>
<p><b>Figure 4.2.4</b>: Center ruby alignment</p>
</div>
</dd>
<dt><strong><del>end</del></strong></dt>
<dt><strong>right</strong></dt>
<dd>The ruby text content is aligned with the end edge of the base.
<p class="issue"><span class="issuehead">Issue: </span> The i18n WG feels that end and right should not be synonymous. Can we drop right (there is no left/right in overhang)? See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=[CSS3+Ruby]%20left/start+and+right/end&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&index-grp=Member__FULL+Public__FULL&index-type=t&type-index=public-i18n-core%40w3.org&resultsperpage=20&sortby=date">this thread</a>.</p>
<div class="figure">
<p><img class="example" width="145" height="91"
alt="Diagram of glyph layout in right aligned ruby when ruby text is shorter than base"
src="images/ra-r.gif" /><img class="example" width="145" height="91"
alt="Diagram of glyph layout in right aligned ruby when ruby text is longer than base"
src="images/ra-r-rb.gif" /></p>
<p><b>Figure 4.2.5</b>: End ruby alignment</p>
</div>
</dd>
<dt><strong>distribute-letter</strong></dt>
<dd>If the width of the ruby text is smaller than that of the base, then
the ruby text contents are evenly distributed across the width of the
base, with the first and last ruby text glyphs lining up with the
corresponding first and last base glyphs. If the width of the ruby text
is at least the width of the base, then the letters of the base are
evenly distributed across the width of the ruby text.
<div class="figure">
<p><img class="example" width="145" height="91"
alt="Diagram of glyph layout in distribute-letter aligned ruby when ruby text is shorter than base"
src="images/ra-dl.gif" /><img class="example" width="145" height="91"
alt="Diagram of glyph layout in distribute-letter aligned ruby when ruby text is longer than base"
src="images/ra-dl-rb.gif" /></p>
<p><b>Figure 4.2.6</b>: Distribute-letter ruby alignment</p>
</div>
</dd>
<dt><strong>distribute-space</strong></dt>
<dd>If the width of the ruby text is smaller than that of the base, then
the ruby text contents are evenly distributed across the width of the
base, with a certain amount of white space preceding the first and
following the last character in the ruby text. That amount of white
space is normally equal to half the amount of inter-character space of
the ruby text. If the width of the ruby text is at least the width of
the base, then the same type of space distribution applies to the base.
In other words, if the base is shorter than the ruby text, the base is
distribute-space aligned. <ins>This type of alignment
is described by [<a href="#jlreq">JLREQ</a>].</ins><del> This type of alignment is sometimes referred
to as the "1:2:1" alignment [<a href="#jis4051">JIS4051</a>].</del>
<div class="figure">
<p><img class="example" width="145" height="91"
alt="Diagram of glyph layout in distribute-space aligned ruby when ruby text is shorter than base"
src="images/ra-ds.gif" /><img class="example" width="145" height="91"
alt="Diagram of glyph layout in distribute-space aligned ruby when ruby text is longer than base"
src="images/ra-ds-rb.gif" /></p>
<p><b>Figure 4.2.7</b>: Distribute-space ruby alignment</p>
</div>
</dd>
<dt><strong>line-edge</strong></dt>
<dd>If the ruby text is not adjacent to a line edge, it is aligned as in
'auto'. If it is adjacent to a line edge, then it is still aligned as in
auto, but the side of the ruby text that touches the end of the line is
lined up with the corresponding edge of the base. This type of alignment
is <del>specified</del><ins>described</ins> by <del>[<a href="#jis4051">JIS4051</a>]</del><ins>[<a href="#jlreq">JLREQ</a>]</ins>. This type of alignment is
relevant only to the scenario where the ruby text is longer than the
ruby base. In the other scenarios, this is just 'auto'.
<div class="figure">
<p><img class="example" width="146" height="109"
alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is shorter than base"
src="images/ra-le-l.gif" /><img class="example" width="146"
height="110"
alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is longer than base"
src="images/ra-le-r.gif" /></p>
<p><b>Figure 4.2.8</b>: Line edge ruby alignment</p>
</div>
</dd>
</dl>
<p>For a complex ruby with spanning elements, one additional consideration is
required. If the spanning element spans multiple 'rows' (other rbc or rtc
elements), and the ruby alignment requires space distribution among the
'spanned' elements, a ratio must be determined among the 'columns' of spanned
elements. This ratio is computed by taking into consideration the widest
element within each column.</p>
<p>In the context of this property, the 'left' and 'right' values are
synonymous with the 'start' and 'end' values respectively. I.e. their meaning
is relative according to the text layout flow. Most of the other CSS
properties interpret 'left' and 'right' on an 'absolute' term. See Appendix A
of the <a href="#CSS3TEXT">CSS3 Text Module</a> for further details.</p>
<h3>4<a id="rubyover">.3 Ruby overhanging: the 'ruby-overhang' property</a></h3>
<table class="propdef" cellspacing="0" cellpadding="0">
<tbody>
<tr align="left"><th>Name:</th><th id="ruby-overhang">ruby-overhang</th></tr>
<tr>
<td><em>Value:</em></td>
<td>auto | start | end | none</td>
</tr>
<tr>
<td><em>Initial:</em></td>
<td>none</td>
</tr>
<tr>
<td><em>Applies to:</em></td>
<td>the parent of elements with display: ruby-text</td>
</tr>
<tr>
<td><em>Inherited:</em></td>
<td>yes</td>
</tr>
<tr>
<td><em>Percentages: </em></td>
<td>N/A</td>
</tr>
<tr>
<td><em>Media:</em></td>
<td>visual</td>
</tr>
<tr>
<td><em>Computed value: </em></td>
<td>specified value (except for initial and inherit)</td>
</tr>
</tbody>
</table>
<p>This property determines whether, and on which side, ruby text is allowed
to partially overhang any adjacent text in addition to its own base, when the
ruby text is wider than the ruby base. Note that ruby text is never allowed to
overhang glyphs belonging to another ruby base. <span class="issue"><span class="issuehead">Issue: </span> This rule must be broken if we are to allow support for jukugo ruby.</span> Also the user agent is free to assume
a maximum amount by which ruby text may overhang adjacent text. The user agent may use
the [<a href="#jis4051">JIS4051</a>] recommendation of using one ruby text character
length as the maximum overhang length. <ins>Detailed rules for how ruby text can overhang adjacent characters for Japanese are described by [<a href="#jlreq">JLREQ</a>].</ins></p>
<p>Possible values:</p>
<dl>