From 81104b94d153e1db27c44672b054d320186e38ea Mon Sep 17 00:00:00 2001 From: Bob Stayton Date: Fri, 6 Mar 2009 22:53:04 +0000 Subject: [PATCH] Add support for writing-mode="rl-tb" (right-to-left) in FO outputs. Changed instances of margin-left to margin-{$direction.align.start} and margin-right to margin-{$direction.align.end}. Those direction.align params are computed from the writing mode value in each locale's gentext key named 'writing-mode', introduced in 1.74.3 to add right-to-left support to HTML outputs. --- xsl/fo/autotoc.xsl | 28 +-- xsl/fo/fo.xsl | 43 ++++ xsl/fo/glossary.xsl | 14 +- xsl/fo/lists.xsl | 3 +- xsl/fo/pagesetup.xsl | 532 +++++++++++++++++++++++++++++++------------ xsl/fo/table.xsl | 50 ++-- 6 files changed, 483 insertions(+), 187 deletions(-) diff --git a/xsl/fo/autotoc.xsl b/xsl/fo/autotoc.xsl index 4d23db297..2c9c83c5a 100644 --- a/xsl/fo/autotoc.xsl +++ b/xsl/fo/autotoc.xsl @@ -275,7 +275,7 @@ - + @@ -339,10 +339,10 @@ + 3em + -3em @@ -398,7 +398,7 @@ and $toc.max.depth > $depth.from.context and $nodes"> - + @@ -434,7 +434,7 @@ and $toc.max.depth > $depth.from.context and $nodes"> - + @@ -472,7 +472,7 @@ and $toc.max.depth > $depth.from.context and $nodes"> - + @@ -506,7 +506,7 @@ and $toc.max.depth > $depth.from.context and refentry"> - + @@ -554,7 +554,7 @@ and $toc.max.depth > $depth.from.context and $nodes"> - + @@ -588,7 +588,7 @@ and $toc.max.depth > $depth.from.context and sect2"> - + @@ -626,7 +626,7 @@ and $toc.max.depth > $depth.from.context and sect3"> - + @@ -666,7 +666,7 @@ and $toc.max.depth > $depth.from.context and sect4"> - + @@ -706,7 +706,7 @@ and $toc.max.depth > $depth.from.context and sect5"> - + @@ -781,7 +781,7 @@ and $toc.max.depth > $depth.from.context and section"> - + @@ -897,7 +897,7 @@ and $toc.max.depth > $depth.from.context and (child::qandadiv or child::qandaentry)"> - + diff --git a/xsl/fo/fo.xsl b/xsl/fo/fo.xsl index e1441c742..69f8668de 100644 --- a/xsl/fo/fo.xsl +++ b/xsl/fo/fo.xsl @@ -13,6 +13,49 @@ ******************************************************************** --> + + + + + + left + left + left + right + left + + + + + + right + right + right + left + right + + + + + + + WARNING: FOP does not support right-to-left writing-mode + lr-tb + + + WARNING: FOP does not support right-to-left writing-mode + lr-tb + + lr-tb + rl-tb + lr-tb + + + + diff --git a/xsl/fo/glossary.xsl b/xsl/fo/glossary.xsl index 7ad78161b..8fdbc3001 100644 --- a/xsl/fo/glossary.xsl +++ b/xsl/fo/glossary.xsl @@ -707,7 +707,7 @@ GlossEntry ::= - + @@ -719,7 +719,7 @@ GlossEntry ::= - + @@ -758,7 +758,9 @@ GlossEntry ::= - + + + @@ -929,9 +931,7 @@ GlossEntry ::= - + @@ -975,7 +975,7 @@ GlossEntry ::= - + diff --git a/xsl/fo/lists.xsl b/xsl/fo/lists.xsl index 4a54a7485..f9cbe545f 100644 --- a/xsl/fo/lists.xsl +++ b/xsl/fo/lists.xsl @@ -544,7 +544,8 @@ - + + 0.25in diff --git a/xsl/fo/pagesetup.xsl b/xsl/fo/pagesetup.xsl index 798a93721..ec9341515 100644 --- a/xsl/fo/pagesetup.xsl +++ b/xsl/fo/pagesetup.xsl @@ -29,23 +29,6 @@ - - - - - - - - - - - - - - - @@ -66,9 +49,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.outer}" - margin-right="{$page.margin.inner}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + blank @@ -94,9 +84,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + titlepage-first @@ -119,9 +116,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + titlepage-odd @@ -144,9 +148,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.outer}" - margin-right="{$page.margin.inner}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + titlepage-even @@ -170,9 +181,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + lot-first @@ -195,9 +213,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + lot-odd @@ -220,9 +245,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.outer}" - margin-right="{$page.margin.inner}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + lot-even @@ -246,9 +278,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + front-first @@ -271,9 +310,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + front-odd @@ -296,9 +342,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.outer}" - margin-right="{$page.margin.inner}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + front-even @@ -322,9 +375,19 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + + + + body-first @@ -347,9 +410,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + body-odd @@ -372,9 +442,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.outer}" - margin-right="{$page.margin.inner}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + body-even @@ -398,9 +475,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + back-first @@ -423,9 +507,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + back-odd @@ -448,9 +539,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.outer}" - margin-right="{$page.margin.inner}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + back-even @@ -474,9 +572,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$page.margin.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + index-first @@ -499,9 +604,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$page.margin.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + index-odd @@ -524,9 +636,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$page.margin.outer}" - margin-right="{$page.margin.inner}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + index-even @@ -551,9 +670,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.outer}" - margin-right="{$page.margin.inner}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + blank-draft @@ -586,9 +712,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + titlepage-first-draft @@ -622,9 +755,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + titlepage-odd-draft @@ -658,9 +798,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.outer}" - margin-right="{$page.margin.inner}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + titlepage-even-draft @@ -695,9 +842,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + lot-first-draft @@ -731,9 +885,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + lot-odd-draft @@ -767,9 +928,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.outer}" - margin-right="{$page.margin.inner}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + lot-even-draft @@ -804,9 +972,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + front-first-draft @@ -840,9 +1015,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + front-odd-draft @@ -876,9 +1058,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.outer}" - margin-right="{$page.margin.inner}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + front-even-draft @@ -913,9 +1102,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + body-first-draft @@ -949,9 +1145,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + body-odd-draft @@ -985,9 +1188,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.outer}" - margin-right="{$page.margin.inner}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + body-even-draft @@ -1022,9 +1232,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + back-first-draft @@ -1058,9 +1275,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + back-odd-draft @@ -1094,9 +1318,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$margin.left.outer}" - margin-right="{$page.margin.inner}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + back-even-draft @@ -1131,9 +1362,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$page.margin.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + index-first-draft @@ -1167,9 +1405,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-left="{$page.margin.inner}" - margin-right="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + index-odd-draft @@ -1203,9 +1448,16 @@ page-width="{$page.width}" page-height="{$page.height}" margin-top="{$page.margin.top}" - margin-bottom="{$page.margin.bottom}" - margin-right="{$page.margin.inner}" - margin-left="{$page.margin.outer}"> + margin-bottom="{$page.margin.bottom}"> + + + + + + + + + index-even-draft @@ -1669,7 +1921,7 @@ - 0pt + 0pt @@ -1733,7 +1985,7 @@ - baseline @@ -1742,7 +1994,7 @@ - + @@ -1770,7 +2022,7 @@ - + @@ -1994,7 +2246,7 @@ - 0pt + 0pt @@ -2057,7 +2309,7 @@ - baseline @@ -2066,7 +2318,7 @@ - + @@ -2085,7 +2337,7 @@ - baseline @@ -2094,7 +2346,7 @@ - + diff --git a/xsl/fo/table.xsl b/xsl/fo/table.xsl index d8613bc24..82f1bdcf1 100644 --- a/xsl/fo/table.xsl +++ b/xsl/fo/table.xsl @@ -274,7 +274,7 @@ - + @@ -299,10 +299,10 @@ - + - + @@ -311,10 +311,10 @@ - + - + @@ -323,10 +323,10 @@ - + - + @@ -337,8 +337,8 @@ - none - none + none + none none @@ -351,30 +351,30 @@ - + - + none none - + - + - + - + - none - none + none + none @@ -387,8 +387,8 @@ - none - none + none + none @@ -409,8 +409,8 @@ - none - none + none + none none none @@ -419,8 +419,8 @@ Impossible frame on table: - none - none + none + none none none @@ -430,7 +430,7 @@ - + @@ -1094,7 +1094,7 @@ - + -- 2.40.0