forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r692424 - /forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-header.ft
Date Fri, 05 Sep 2008 12:39:03 GMT
Author: sjur
Date: Fri Sep  5 05:39:02 2008
New Revision: 692424

URL: http://svn.apache.org/viewvc?rev=692424&view=rev
Log:
Bringing this contract in line with the skins-based pdf generation by adding the font-family
attribute, and at the same time adding support for user-specification of the font family.

Also, the framework for controlling header placement according to double/single-sided is in
place (copied from skins), although the actual toggling does not work, because the needed
variable isn't available.

Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-header.ft

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-header.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-header.ft?rev=692424&r1=692423&r2=692424&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-header.ft
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-header.ft
Fri Sep  5 05:39:02 2008
@@ -35,18 +35,65 @@
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       xmlns:fo="http://www.w3.org/1999/XSL/Format"
       version="1.0">
+      <xsl:param name="defaultVariables" select="'test.html'"/>
+      <xsl:param name="sans-serif" select="$defaultVariables/*/*[@name='output.pdf.fontFamily.sansSerif']/@value"
/>
+      <xsl:param name="headerFooterFontFamily">
+        <xsl:choose>
+          <xsl:when test="$defaultVariables/*/*[@name='output.pdf.fontFamily.headerFooterFontFamily']">
+            <xsl:value-of select="$defaultVariables/*/*[@name='output.pdf.fontFamily.headerFooterFontFamily']/@value"/>
+          </xsl:when>
+          <xsl:otherwise><xsl:value-of select="$sans-serif"/></xsl:otherwise>
+        </xsl:choose>
+      </xsl:param>
+      <xsl:param name="evenHeaderFontFamily">
+        <xsl:choose>
+          <xsl:when test="$defaultVariables/*/*[@name='output.pdf.fontFamily.evenHeaderFontFamily']">
+            <xsl:value-of select="$defaultVariables/*/*[@name='output.pdf.fontFamily.evenHeaderFontFamily']/@value"/>
+          </xsl:when>
+          <xsl:otherwise><xsl:value-of select="$headerFooterFontFamily"/></xsl:otherwise>
+        </xsl:choose>
+      </xsl:param>
+      <xsl:param name="oddHeaderFontFamily">
+        <xsl:choose>
+          <xsl:when test="$defaultVariables/*/*[@name='output.pdf.fontFamily.oddHeaderFontFamily']">
+            <xsl:value-of select="$defaultVariables/*/*[@name='output.pdf.fontFamily.oddHeaderFontFamily']/@value"/>
+          </xsl:when>
+          <xsl:otherwise><xsl:value-of select="$headerFooterFontFamily"/></xsl:otherwise>
+        </xsl:choose>
+      </xsl:param>
+<!-- Double-sided printing toggle -->
+<!-- NB! This does not yet work, because the $config variable isn't available! -->
+      <xsl:variable
+            name="doublesided"
+            select="'true'" />
+<!--            select="string($config/pdf/margins/@double-sided)" /-->
       <xsl:template match="/">
         <forrest:content>
           <forrest:part xpath="/fo/page-sequence">
-            <fo:static-content flow-name="even-header">
-              <fo:block font-size="70%" text-align="end"
+            <fo:static-content
+              flow-name="even-header"
+              font-family="{$evenHeaderFontFamily}">
+              <fo:block
+                font-size="70%"
+                text-align="end"
                 font-style="italic">
                 <xsl:value-of select="title"/>
               </fo:block>
             </fo:static-content>
-            <fo:static-content flow-name="odd-header">
-              <fo:block font-size="70%" text-align="start"
+            <fo:static-content
+              flow-name="odd-header"
+              font-family="{$oddHeaderFontFamily}">
+              <fo:block
+                font-size="70%"
                 font-style="italic">
+                <xsl:choose>
+                  <xsl:when test="$doublesided = 'true'">
+                    <xsl:attribute name="text-align">start</xsl:attribute>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:attribute name="text-align">end</xsl:attribute>
+                  </xsl:otherwise>
+                </xsl:choose>
                 <xsl:value-of select="title"/>
               </fo:block>
             </fo:static-content>



Mime
View raw message