forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r635088 - in /forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets: document-to-fo.xsl helper-commonElements.xsl
Date Sat, 08 Mar 2008 21:19:14 GMT
Author: thorsten
Date: Sat Mar  8 13:19:12 2008
New Revision: 635088

URL: http://svn.apache.org/viewvc?rev=635088&view=rev
Log:
Two changes:
- Bugfix: Don't fail on ul/dl which can appear in document-v11.
- font-family cleanup.

Contributed by: Jeremias Maerki
Issue: FOR-1072
Related-comment: https://issues.apache.org/jira/browse/FOR-1072?focusedCommentId=12575151#action_12575151
Patch: forrest-pdf-touchup4.patch (9 kb)

Thanks Jeremias.

Modified:
    forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl
    forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-commonElements.xsl

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl?rev=635088&r1=635087&r2=635088&view=diff
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl
(original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl
Sat Mar  8 13:19:12 2008
@@ -123,7 +123,8 @@
   <xsl:template
         match="/">
     <fo:root
-            xmlns:fo="http://www.w3.org/1999/XSL/Format">
+            xmlns:fo="http://www.w3.org/1999/XSL/Format"
+            font-family="serif" font-size="12pt">
       <fo:layout-master-set>
         <fo:simple-page-master
                     master-name="first-page"
@@ -236,14 +237,15 @@
       </fo:page-sequence>
     </fo:root>
   </xsl:template>
-  <xsl:template
-        match="document">
+  
+  <xsl:template match="document">
     <fo:title>
-      <xsl:value-of
-                select="header/title" />
+      <xsl:value-of select="header/title" />
     </fo:title>
+    
     <fo:static-content
-            flow-name="first-footer">
+            flow-name="first-footer"
+            font-family="sans-serif">
       <fo:block
                 border-top="0.25pt solid"
                 padding-before="6pt"
@@ -263,8 +265,10 @@
       <xsl:call-template
                 name="info" />
     </fo:static-content>
+    
     <fo:static-content
-            flow-name="even-header">
+            flow-name="even-header"
+            font-family="sans-serif">
       <fo:block
                 font-size="70%"
                 text-align="end"
@@ -274,7 +278,8 @@
       </fo:block>
     </fo:static-content>
     <fo:static-content
-            flow-name="even-footer">
+            flow-name="even-footer"
+            font-family="sans-serif">
       <fo:block
                 border-top="0.25pt solid"
                 padding-before="6pt"
@@ -297,8 +302,10 @@
       <xsl:call-template
                 name="info" />
     </fo:static-content>
+    
     <fo:static-content
-            flow-name="odd-header">
+            flow-name="odd-header"
+            font-family="sans-serif">
       <fo:block
                 font-size="70%"
                 font-style="italic">
@@ -314,8 +321,10 @@
                     select="header/title" />
       </fo:block>
     </fo:static-content>
+    
     <fo:static-content
-            flow-name="odd-footer">
+            flow-name="odd-footer"
+            font-family="sans-serif">
       <fo:block
                 border-top="0.25pt solid"
                 padding-before="6pt"
@@ -331,16 +340,18 @@
       <xsl:call-template
                 name="info" />
     </fo:static-content>
+    
     <fo:flow
             flow-name="xsl-region-body">
       <fo:block
-                padding-before="24pt"
-                padding-after="24pt"
-                font-size="24pt"
-                font-weight="bold"
-                id="{generate-id()}">
+              padding-before="24pt"
+              padding-after="24pt"
+              font-family="sans-serif"
+              font-size="24pt"
+              font-weight="bold"
+              id="{generate-id()}">
         <xsl:value-of
-                    select="header/title" />
+          select="header/title" />
       </fo:block>
       <fo:block
                 text-align="{$text-align}"
@@ -360,7 +371,6 @@
             text-align="center"
             space-before="20pt"
             space-after="25pt"
-            font-family="serif"
             font-style="italic">
       <xsl:call-template
                 name="insertPageBreaks" />
@@ -373,7 +383,6 @@
             font-size="10pt"
             text-align="left"
             space-before="20pt"
-            font-family="serif"
             border-top="0.25pt solid"
             border-bottom="0.25pt solid"
             padding-before="6pt"
@@ -395,6 +404,7 @@
   </xsl:template>
   <xsl:template match="version">
     <fo:block
+            font-family="sans-serif"
             font-weight="bold"
             font-size="smaller">
       <xsl:call-template name="insertPageBreaks"/>
@@ -415,6 +425,7 @@
   <xsl:template match="authors">
     <fo:block
             space-before="2em"
+            font-family="sans-serif"
             font-weight="bold"
             font-size="smaller">
       <xsl:call-template
@@ -436,7 +447,7 @@
         <!-- insert i18n stuff here -->
         <xsl:text>Table of contents</xsl:text>
       </fo:block>
-      <fo:block font-family="serif" font-size="12pt" space-after="5pt"
+      <fo:block font-size="12pt" space-after="5pt"
         space-before="0pt" text-align="justify">
         <xsl:if test="$page-break-top-sections">
           <xsl:attribute name="break-after">page</xsl:attribute>

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-commonElements.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-commonElements.xsl?rev=635088&r1=635087&r2=635088&view=diff
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-commonElements.xsl
(original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-commonElements.xsl
Sat Mar  8 13:19:12 2008
@@ -95,14 +95,14 @@
   <xsl:template match="p">
     <xsl:choose>
       <xsl:when test="ancestor::li and not(preceding-sibling::*)">
-        <fo:block space-after="4pt" font-family="serif">
+        <fo:block space-after="4pt">
           <xsl:copy-of select="@id"/>
           <xsl:call-template name="insertPageBreaks"/>
           <xsl:apply-templates/>
         </fo:block>
       </xsl:when>
       <xsl:otherwise>
-        <fo:block space-before="4pt" space-after="4pt" font-family="serif">
+        <fo:block space-before="4pt" space-after="4pt">
           <xsl:copy-of select="@id"/>
           <xsl:call-template name="insertPageBreaks"/>
           <xsl:apply-templates/>
@@ -141,7 +141,7 @@
         </fo:block>
       </fo:list-item-label>
       <fo:list-item-body start-indent="body-start()">
-        <fo:block font-family="serif">
+        <fo:block>
           <xsl:apply-templates/>
         </fo:block>
       </fo:list-item-body>
@@ -149,7 +149,7 @@
   </xsl:template>
   <!-- Emulate browser handling of these invalid combinations that our DTD
   unfortunately allows -->
-  <xsl:template match="ul/ul | ul/ol | ol/ul | ol/ol">
+  <xsl:template match="ul/ul | ul/ol | ol/ul | ol/ol | ul/dl | ol/dl">
     <fo:list-item>
       <xsl:copy-of select="@id"/>
       <fo:list-item-label end-indent="label-end()">
@@ -173,7 +173,7 @@
         </fo:block>
       </fo:list-item-label>
       <fo:list-item-body start-indent="body-start()">
-        <fo:block font-family="serif">
+        <fo:block>
           <xsl:apply-templates/>
         </fo:block>
       </fo:list-item-body>
@@ -248,7 +248,7 @@
       </xsl:choose>
       <xsl:value-of select="title"/>
     </fo:block>
-    <fo:block margin-left="0.25in" margin-right="0.25in" font-family="serif"
+    <fo:block margin-left="0.25in" margin-right="0.25in"
       font-size="10pt" border-after-style="solid" border-start-style="solid"
       border-end-style="solid" border-color="{$color}" background-color="#fff0f0"
       padding-start="3pt" padding-end="3pt" padding-before="3pt"
@@ -275,7 +275,7 @@
       </xsl:choose>
       <xsl:value-of select="title"/>
     </fo:block>
-    <fo:block margin-left="0.25in" margin-right="0.25in" font-family="serif"
+    <fo:block margin-left="0.25in" margin-right="0.25in"
       font-size="10pt" space-after="10pt" border-after-style="solid"
       border-start-style="solid" border-end-style="solid" border-color="{$color}"
       background-color="#F0F0FF" padding-start="3pt" padding-end="3pt"
@@ -296,7 +296,7 @@
       <!-- insert i18n stuff here --> FIXME (
       <xsl:value-of select="@author"/>):
       <xsl:value-of select="title"/> </fo:block>
-    <fo:block margin-left="0.25in" margin-right="0.25in" font-family="serif"
+    <fo:block margin-left="0.25in" margin-right="0.25in"
       font-size="10pt" space-after="10pt" border-after-style="solid"
       border-start-style="solid" border-end-style="solid" border-color="{$color}"
       background-color="#FFF0F0" padding-start="3pt" padding-end="3pt"
@@ -445,11 +445,11 @@
       <!-- End of hack for Fop support (if removing this hack, remember
       you need the <fo:table> element) -->
       <xsl:if test="tr[count(th) &gt; 0 and count(td) = 0]">
-        <fo:table-header font-size="10pt" font-family="serif">
+        <fo:table-header font-size="10pt">
           <xsl:apply-templates select="tr[count(th) &gt; 0 and count(td) = 0]"/>
         </fo:table-header>
       </xsl:if>
-      <fo:table-body font-size="10pt" font-family="serif">
+      <fo:table-body font-size="10pt">
         <xsl:apply-templates select="tr[count(td) &gt; 0]"/>
       </fo:table-body>
     </fo:table>
@@ -541,7 +541,7 @@
   </xsl:template>
   <xsl:template match="p[@class='quote']">
     <fo:block padding="3pt" margin="0" space-before="4pt" space-after="4pt"
-      background-color="#f0f0f0" font-family="serif" font-style="italic">
+      background-color="#f0f0f0" font-style="italic">
       <xsl:copy-of select="@id"/>
       <xsl:call-template name="insertPageBreaks"/>
       <xsl:apply-templates/>



Mime
View raw message