|
1 | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | 2 | <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 $ --> |
4 | 4 | <HEAD> |
5 | 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
6 | 6 | <TITLE>Visual rendering model</TITLE> |
@@ -945,21 +945,18 @@ around text in different lines may overlap. |
945 | 945 |
|
946 | 946 | <h3><a name="direction">Writing and flow direction</a></h3> |
947 | 947 |
|
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 |
950 | 949 | characters and defines a (complex) algorithm for determining the |
951 | 950 | proper directionality of text. The <span |
952 | 951 | class="propinst-direction">'direction'</span> and <span |
953 | 952 | class="propinst-unicode-bidi">'unicode-bidi'</span> properties allow |
954 | 953 | authors to specify the writing direction of an element's text in terms |
955 | 954 | 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. |
958 | 956 |
|
959 | 957 | <P>If a document does not contain a displayable right-to-left |
960 | 958 | 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]] |
963 | 960 | bidirectional algorithm. If a document contains right-to-left |
964 | 961 | characters, and if the user agent displays these characters (with |
965 | 962 | appropriate glyphs, not arbitrary substitutes such as a question mark, |
@@ -1040,9 +1037,7 @@ class="propinst-margin">'margin'</span> properties. |
1040 | 1037 | factors:</p> |
1041 | 1038 |
|
1042 | 1039 | <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]]. |
1046 | 1041 | <li>The value of the <span |
1047 | 1042 | class="propinst-unicode-bidi">'unicode-bidi'</span> property. |
1048 | 1043 | </ol> |
@@ -1099,7 +1094,93 @@ and inline elements with respect to the "dir" attribute:</p> |
1099 | 1094 | </div> |
1100 | 1095 |
|
1101 | 1096 |
|
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 | +<HEBREW> |
| 1104 | + <PAR>HEBREW1 HEBREW2 english3 HEBREW4 HEBREW5</PAR> |
| 1105 | + <PAR>HEBREW6 <EMPH>HEBREW7</EMPH> HEBREW8</PAR> |
| 1106 | +</HEBREW> |
| 1107 | +<ENGLISH> |
| 1108 | + <PAR>english9 english10 english11 HEBREW12 HEBREW13</PAR> |
| 1109 | + <PAR>english14 english15 english16</PAR> |
| 1110 | + <PAR>english17 <HE-QUO>HEBREW18 english19 HEBREW20</HE-QUO></PAR> |
| 1111 | +</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 | + |
1103 | 1184 |
|
1104 | 1185 | <H3><a name="relative-positioning">Relative positioning</a></H3> |
1105 | 1186 |
|
|
0 commit comments