Skip to content

Commit bbe112b

Browse files
committed
[css2] Added long XML example for bidi.
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%40956
1 parent d3e93c8 commit bbe112b

1 file changed

Lines changed: 92 additions & 11 deletions

File tree

css2/visuren.src

Lines changed: 92 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22
<html lang="en">
3-
<!-- $Id: visuren.src,v 2.8 1998-02-17 23:13:20 ijacobs Exp $ -->
3+
<!-- $Id: visuren.src,v 2.9 1998-02-17 23:51:28 bbos Exp $ -->
44
<HEAD>
55
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66
<TITLE>Visual rendering model</TITLE>
@@ -945,21 +945,18 @@ around text in different lines may overlap.
945945

946946
<h3><a name="direction">Writing and flow direction</a></h3>
947947

948-
<P>The <a rel="biblioentry" href="./refs.html#ref-UNICODE"
949-
class="normref">[UNICODE]</a> specification assigns directionality to
948+
<P>The [[UNICODE]] specification assigns directionality to
950949
characters and defines a (complex) algorithm for determining the
951950
proper directionality of text. The <span
952951
class="propinst-direction">'direction'</span> and <span
953952
class="propinst-unicode-bidi">'unicode-bidi'</span> properties allow
954953
authors to specify the writing direction of an element's text in terms
955954
of the Unicode bidirectional algorithm. For an introduction to
956-
bidirectionality issues, please consult <a rel="biblioentry"
957-
href="./refs.html#ref-HTML40">[HTML40]</a>, section 8.2.
955+
bidirectionality issues, please consult [[HTML40]], section 8.2.
958956

959957
<P>If a document does not contain a displayable right-to-left
960958
character, a <a href="conform.html#conformance">conforming user
961-
agent</a> is not required to apply the <a rel="biblioentry"
962-
href="./refs.html#ref-UNICODE" class="normref">[UNICODE]</a>
959+
agent</a> is not required to apply the [[UNICODE]]
963960
bidirectional algorithm. If a document contains right-to-left
964961
characters, and if the user agent displays these characters (with
965962
appropriate glyphs, not arbitrary substitutes such as a question mark,
@@ -1040,9 +1037,7 @@ class="propinst-margin">'margin'</span> properties.
10401037
factors:</p>
10411038

10421039
<ol>
1043-
<li>The directionality of the characters, as specified in <a
1044-
rel="biblioentry" href="./refs.html#ref-UNICODE"
1045-
class="normref">[UNICODE]</a>.
1040+
<li>The directionality of the characters, as specified in [[UNICODE]].
10461041
<li>The value of the <span
10471042
class="propinst-unicode-bidi">'unicode-bidi'</span> property.
10481043
</ol>
@@ -1099,7 +1094,93 @@ and inline elements with respect to the "dir" attribute:</p>
10991094
</div>
11001095

11011096

1102-
<P><em>[Add XML example here. Perhaps base on HTML 4.0 examples? -IJ].</em>
1097+
<div class="example">
1098+
<p>The following example shows an XML document with bidirectional
1099+
text. Lowercase letters stand for inherently left-to-right characters,
1100+
Uppercase letters represent inherently right-to-left characters:
1101+
1102+
<pre class="xml-example">
1103+
&lt;HEBREW>
1104+
&lt;PAR>HEBREW1 HEBREW2 english3 HEBREW4 HEBREW5&lt;/PAR>
1105+
&lt;PAR>HEBREW6 &lt;EMPH>HEBREW7&lt;/EMPH> HEBREW8&lt;/PAR>
1106+
&lt;/HEBREW>
1107+
&lt;ENGLISH>
1108+
&lt;PAR>english9 english10 english11 HEBREW12 HEBREW13&lt;/PAR>
1109+
&lt;PAR>english14 english15 english16&lt;/PAR>
1110+
&lt;PAR>english17 &lt;HE-QUO>HEBREW18 english19 HEBREW20&lt;/HE-QUO>&lt;/PAR>
1111+
&lt;/ENGLISH>
1112+
</pre>
1113+
1114+
<p>Since this is XML, the style sheet is responsible for setting the
1115+
writing direction. (Another possibility is to use the Unicode
1116+
characters LRE, RTF, PDF, in the text.) This is the style sheet:
1117+
1118+
<pre class="example">
1119+
HEBREW {display: block; direction: rtl}
1120+
ENGLISH {display: block; direction: ltr}
1121+
PAR {display: block}
1122+
EMPH {font-weight: bold}
1123+
HE-QUO {direction: rtl; unicode-bidi: embed}
1124+
</pre>
1125+
1126+
<p>The HEBREW element is a block with a right-to-left base direction,
1127+
the ENGLISH element is a block with a left-to-right base
1128+
direction. The PARs are blocks that inherit the base direction from
1129+
their parents. Thus, the first two PARs are read starting at the top
1130+
right, the final three are read starting at the top left.
1131+
1132+
<p>The EMPH element is inline, and since its value for 'unicode-bidi'
1133+
is 'normal' (the initial value), it has no effect on the ordering of
1134+
the text. The HE-QUO element, on the other hand, creates an embedding.
1135+
1136+
<p>The rendering of this text might look like this if the line length
1137+
is long:
1138+
1139+
<pre class="ascii-art">
1140+
5WERBEH 4WERBEH english3 2WERBEH 1WERBEH
1141+
1142+
8WERBEH <b>7WERBEH</b> 6WERBEH
1143+
1144+
english9 english10 english11 13WERBEH 12WERBEH
1145+
1146+
english14 english15 english16
1147+
1148+
english17 20WERBEH english19 18WERBEH
1149+
</pre>
1150+
1151+
<p>Note that the HE-QUO embedding causes HEBREW18 to be to the right
1152+
of english19.
1153+
1154+
<p>If lines have to be broken, it might be more like this:
1155+
1156+
<pre class="ascii-art">
1157+
2WERBEH 1WERBEH
1158+
-EH 4WERBEH english3
1159+
5WERB
1160+
1161+
-EH <b>7WERBEH</b> 6WERBEH
1162+
8WERB
1163+
1164+
english9 english10 en-
1165+
glish11 12WERBEH
1166+
13WERBEH
1167+
1168+
english14 english15
1169+
english16
1170+
1171+
english17 18WERBEH
1172+
20WERBEH english19
1173+
</pre>
1174+
1175+
<p>Because HEBREW18 must be read before english19, it is on the line
1176+
above english19. Just breaking the long line from the earlier
1177+
rendering would not have worked. Note also that the first syllable
1178+
from english19 might have fitted on the previous line, but you can't
1179+
hyphenate left-to-right words in a left-to-right context, and vice
1180+
versa.
1181+
1182+
</div><!-- example -->
1183+
11031184

11041185
<H3><a name="relative-positioning">Relative positioning</a></H3>
11051186

0 commit comments

Comments
 (0)