You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by sj...@apache.org on 2008/07/03 09:35:03 UTC
svn commit: r673601 - in
/forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets:
document-to-fo.xsl helper-commonElements.xsl
Author: sjur
Date: Thu Jul 3 00:35:02 2008
New Revision: 673601
URL: http://svn.apache.org/viewvc?rev=673601&view=rev
Log:
Changed hard-coded font-family specifications into variables.
This is done in preparation for moving the font-family specification out to the config system, so that users can easily change them if needed (typically for non-Roman or extended-Roman charsets).
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=673601&r1=673600&r2=673601&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 Thu Jul 3 00:35:02 2008
@@ -98,6 +98,16 @@
<xsl:param
name="numbering-max-depth"
select="'3'" />
+<!-- Font-family variables defined here: -->
+ <xsl:param
+ name="sans-serif"
+ select="'sans-serif'" />
+ <xsl:param
+ name="serif"
+ select="'serif'" />
+ <xsl:param
+ name="monospace"
+ select="'monospace'" />
<xsl:param
name="imagesdir"
select="." />
@@ -124,7 +134,7 @@
match="/">
<fo:root
xmlns:fo="http://www.w3.org/1999/XSL/Format"
- font-family="serif" font-size="12pt">
+ font-family="{$serif}" font-size="12pt">
<fo:layout-master-set>
<fo:simple-page-master
master-name="first-page"
@@ -245,7 +255,7 @@
<fo:static-content
flow-name="first-footer"
- font-family="sans-serif">
+ font-family="{$sans-serif}">
<fo:block
border-top="0.25pt solid"
padding-before="6pt"
@@ -268,7 +278,7 @@
<fo:static-content
flow-name="even-header"
- font-family="sans-serif">
+ font-family="{$sans-serif}">
<fo:block
font-size="70%"
text-align="end"
@@ -279,7 +289,7 @@
</fo:static-content>
<fo:static-content
flow-name="even-footer"
- font-family="sans-serif">
+ font-family="{$sans-serif}">
<fo:block
border-top="0.25pt solid"
padding-before="6pt"
@@ -305,7 +315,7 @@
<fo:static-content
flow-name="odd-header"
- font-family="sans-serif">
+ font-family="{$sans-serif}">
<fo:block
font-size="70%"
font-style="italic">
@@ -324,7 +334,7 @@
<fo:static-content
flow-name="odd-footer"
- font-family="sans-serif">
+ font-family="{$sans-serif}">
<fo:block
border-top="0.25pt solid"
padding-before="6pt"
@@ -346,7 +356,7 @@
<fo:block
padding-before="24pt"
padding-after="24pt"
- font-family="sans-serif"
+ font-family="{$sans-serif}"
font-size="24pt"
font-weight="bold"
id="{generate-id()}">
@@ -404,7 +414,7 @@
</xsl:template>
<xsl:template match="version">
<fo:block
- font-family="sans-serif"
+ font-family="{$sans-serif}"
font-weight="bold"
font-size="smaller">
<xsl:call-template name="insertPageBreaks"/>
@@ -425,7 +435,7 @@
<xsl:template match="authors">
<fo:block
space-before="2em"
- font-family="sans-serif"
+ font-family="{$sans-serif}"
font-weight="bold"
font-size="smaller">
<xsl:call-template
@@ -441,7 +451,7 @@
</xsl:template>
<xsl:template match="body[count(//section) != 0]">
<xsl:if test="$disable-toc != 'true' and $toc-max-depth > 0">
- <fo:block font-family="sans-serif" font-size="12pt" font-weight="bold"
+ <fo:block font-family="{$sans-serif}" font-size="12pt" font-weight="bold"
space-after="0.5em" space-before="1em" text-align="justify" id="__toc__">
<xsl:call-template name="insertPageBreaks"/>
<!-- insert i18n stuff here -->
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=673601&r1=673600&r2=673601&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 Thu Jul 3 00:35:02 2008
@@ -31,7 +31,7 @@
<xsl:variable name="size">
<xsl:value-of select="12-number($level)"/>
</xsl:variable>
- <fo:block font-family="sans-serif" font-size="{$size}pt" font-weight="bold"
+ <fo:block font-family="{$sans-serif}" font-size="{$size}pt" font-weight="bold"
space-before="12pt" space-after="8pt" margin="0" keep-with-next.within-column="always">
<xsl:call-template name="insertPageBreaks"/>
<xsl:attribute name="id">
@@ -116,7 +116,7 @@
<xsl:template match="source">
<xsl:variable name="color"
select="$config/colors/color[@name='code']/@value"/>
- <fo:block font-family="monospace" font-size="8pt" padding="6pt" margin="0"
+ <fo:block font-family="{$monospace}" font-size="8pt" padding="6pt" margin="0"
background-color="{$color}" white-space-collapse="false"
linefeed-treatment="preserve" white-space-treatment="preserve"
wrap-option="wrap" text-align="start">
@@ -228,7 +228,7 @@
</fo:inline>
</xsl:template>
<xsl:template match="code">
- <fo:inline font-family="monospace">
+ <fo:inline font-family="{$monospace}">
<xsl:copy-of select="@id"/>
<xsl:apply-templates/>
</fo:inline>
@@ -238,7 +238,7 @@
select="$config/colors/color[@name='warning']/@value"/>
<fo:block margin-left="0.25in" margin-right="0.25in" padding-left="3pt"
padding-top="2pt" padding-bottom="1pt" font-size="9pt"
- font-family="sans-serif" space-before="10pt" border-before-style="solid"
+ font-family="{$sans-serif}" space-before="10pt" border-before-style="solid"
border-start-style="solid" border-end-style="solid" border-color="{$color}"
background-color="{$color}" color="#ffffff" keep-with-previous.within-column="always" keep-with-next.within-column="always">
<xsl:copy-of select="@id"/>
@@ -264,7 +264,7 @@
select="$config/colors/color[@name='note']/@value"/>
<fo:block margin-left="0.25in" margin-right="0.25in" padding-left="3pt"
font-size="9pt" padding-top="2pt" padding-bottom="1pt" color="#ffffff"
- font-family="sans-serif" space-before="10pt" border-before-style="solid"
+ font-family="{$sans-serif}" space-before="10pt" border-before-style="solid"
border-start-style="solid" border-end-style="solid" border-color="{$color}"
background-color="{$color}" keep-with-previous.within-column="always" keep-with-next.within-column="always">
<xsl:copy-of select="@id"/>
@@ -291,7 +291,7 @@
select="$config/colors/color[@name='fixme']/@value"/>
<fo:block margin-left="0.25in" margin-right="0.25in" padding-left="3pt"
font-size="9pt" padding-top="2pt" padding-bottom="1pt" color="#FFFFFF"
- font-family="sans-serif" space-before="10pt" border-before-style="solid"
+ font-family="{$sans-serif}" space-before="10pt" border-before-style="solid"
border-start-style="solid" border-end-style="solid" border-color="{$color}"
background-color="{$color}" keep-with-previous.within-column="always" keep-with-next.within-column="always">
<xsl:copy-of select="@id"/>