XML technologies / XSL-FO / Reference / Attributes in XSL-FO / writing-mode
(Excerpt from "XSL-FO ― Die Referenz" by Manuel Montero Pineda & Steffen Herkert, 2016, dpunkt.verlag)
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
Recommendation section: 7.29.7
Category: 7.29 Writing-mode-related Properties
Description
This attribute sets the writing direction. On page masters (<fo:simple-page-master>), writing-mode affects the placement of fo-region-body, fo-region-before, fo-region-after, fo-region-start, and fo-region-end. On tables, writing-mode controls horizontal alignment of columns or cells and vertical alignment of rows. Tables can thus be displayed in landscape orientation, for example.
Values
lr-tb | The most widespread writing direction, customary in Western countries: left to right and top to bottom. |
rl-tb | This direction, used for example in Arabic or Hebrew, runs right to left and top to bottom. Depending on the formatter, letters may also be displayed as mirror images. |
tb-rl | This direction, common in Asia, for example in Japanese or Chinese, runs top to bottom and right to left. |
lr | This value abbreviates the writing direction lr-tb. |
rl | This value abbreviates the writing direction rl-tb. |
tb | This value abbreviates the writing direction tb-rl. |
tb-lr | Writing direction: top to bottom and left to right; not yet supported by formatters. |
lr-bt | Writing direction: left to right and bottom to top; not yet supported by formatters. |
bt-lr | Writing direction: bottom to top and left to right; not yet supported by formatters. |
bt-rl | Writing direction: bottom to top and right to left; not yet supported by formatters. |
rl-bt | Writing direction: right to left and bottom to top; not yet supported by formatters. |
lr-alternating-rl-tb | lr-alternating-rl-bt | These values alternate the writing direction: the first and all odd-numbered lines run left to right, and even-numbered lines right to left. Formatters do not yet support this. It suits boustrophedon writing, used in ancient Greek, Etruscan, and Latin inscriptions. |
lr-inverting-rl-bt | lr-inverting-rl-tb | These values behave like "alternating", but even-numbered lines are inverted. Formatters do not yet support this. |
tb-lr-in-lr-pairs | Text is written in pairs of characters, top to bottom and right to left. Formatters do not yet support this. |
Inherited: | yes |
Default value: lr-tb
XSL-FO version: 1.0
Allowed in:
<fo:block-container> , <fo:inline-container> , <fo:page-sequence> , <fo:region-after> , <fo:region-before> , <fo:region-body> , <fo:region-end> , <fo:region-start> , <fo:simple-page-master> and <fo:table>
Support:
Conformance level | Antenna House | FOP | RenderX XEP | Altsoft XML2PDF | Compart DocBridge |
Basic | P | P | Y | Y | N |
XSL-FO example:
<fo:root font-family="Arial" font-size="10pt" line-height="1.2em" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:cpfo="http://www.compart.net/xmlns/cpfo" xmlns:svg="http://www.w3.org/2000/svg" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
<fo:layout-master-set>
<fo:simple-page-master master-name="Inhalt-Seiten" margin="0mm 0mm 0mm
0mm" page-height="297mm" page-width="210mm">
<fo:region-body margin="26mm 55mm 41mm
55mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Inhalt-Seiten">
<fo:flow flow-name="xsl-region-body">
<fo:block-container absolute-position="fixed" top="25mm" left="25mm" height="50mm" width="50mm" z-index="2" writing-mode="lr">
<fo:block font-family="Arial Unicode MS">
Die Standard Schreibrichtung für normalen Text. Inline Komponenten und Text werden
von rechts nach links angeordnet dargestellt, Zeilen und Blockelemente werden von
oben nach unten angeordnet dargestellt.
</fo:block>
</fo:block-container>
<fo:block-container absolute-position="fixed" top="25mm" left="100mm" height="50mm" width="50mm" z-index="2" writing-mode="rl">
<fo:block font-family="Arial Unicode MS">
Beschreibt die
Schreibrichtung für zum Beispiel Arabischen oder Hebreischen Text. Inline
Komponenten und Text werden von links nach rechts angeordnet dargestellt, Zeilen und
Blockelemente werden von oben nach unten angeordnet dargestellt.
</fo:block>
</fo:block-container>
<fo:block-container absolute-position="fixed" top="100mm" left="25mm" height="50mm" width="50mm" z-index="2" writing-mode="tb-rl">
<fo:block font-family="Arial Unicode MS">
Beschreibt die Schreibrichtung für zum Beispiel Japanischen oder Chinesichen Text.
Oft werden hiermit auch auf Seiten gekippt stehende Tabellen und Abbildungen
dargestellt. Inline Komponenten und Text werden von oben nach unten angeordnet
dargestellt, Zeilen und Blockelemente werden von rechts nach links angeordnet
dargestellt.
</fo:block>
</fo:block-container>
</fo:flow>
</fo:page-sequence>
</fo:root>In the output:
Excerpt from the W3C Recommendation: