[MPPDF-56] Add support for <font> and <samp> tags.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@609731 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl 2008-01-07 18:40:58 +00:00
parent fda88665cf
commit 6ac6b1be85
3 changed files with 137 additions and 1 deletions

View File

@ -23,7 +23,7 @@
<pomVersion>3</pomVersion>
<artifactId>maven-pdf-plugin</artifactId>
<name>Maven PDF Plugin</name>
<currentVersion>2.5.1</currentVersion>
<currentVersion>2.5.2-SNAPSHOT</currentVersion>
<description>PDF Documentation generator</description>
<shortDescription>Generator of project documentation in PDF Format.</shortDescription>
<versions>

View File

@ -761,5 +761,138 @@
</xsl:apply-templates>
</fo:block>
</xsl:template>
<xsl:template match="samp">
<xsl:param name="chapterNumber"/>
<xsl:param name="fileName"/>
<fo:inline font-family="monospace" font-size="110%">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
<xsl:with-param name="fileName">
<xsl:value-of select="$fileName"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:inline>
</xsl:template>
<xsl:template match="font">
<xsl:param name="chapterNumber"/>
<xsl:param name="fileName"/>
<xsl:variable name="color">
<xsl:choose>
<xsl:when test="@color">
<xsl:value-of select="@color"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>inherited-property-value(color)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="face">
<xsl:choose>
<xsl:when test="@face">
<xsl:value-of select="@face"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>inherited-property-value(font-family)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="size">
<xsl:choose>
<xsl:when test="@size">
<xsl:choose>
<!-- if size is given in pt or %, use it as is -->
<xsl:when test="contains(@size, 'pt')">
<xsl:value-of select="@size"/>
</xsl:when>
<xsl:when test="contains(@size, '%')">
<xsl:value-of select="@size"/>
</xsl:when>
<!-- otherwise set to arbitrary values -->
<xsl:when test="@size = '+1'">
<xsl:text>110%</xsl:text>
</xsl:when>
<xsl:when test="@size = '+2'">
<xsl:text>120%</xsl:text>
</xsl:when>
<xsl:when test="@size = '+3'">
<xsl:text>130%</xsl:text>
</xsl:when>
<xsl:when test="@size = '+4'">
<xsl:text>140%</xsl:text>
</xsl:when>
<xsl:when test="@size = '+5'">
<xsl:text>150%</xsl:text>
</xsl:when>
<xsl:when test="@size = '+6'">
<xsl:text>160%</xsl:text>
</xsl:when>
<xsl:when test="@size = '+7'">
<xsl:text>170%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-1'">
<xsl:text>90%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-2'">
<xsl:text>80%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-3'">
<xsl:text>70%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-4'">
<xsl:text>60%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-5'">
<xsl:text>50%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-6'">
<xsl:text>40%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-7'">
<xsl:text>30%</xsl:text>
</xsl:when>
<xsl:when test="@size = '1'">
<xsl:text>8pt</xsl:text>
</xsl:when>
<xsl:when test="@size = '2'">
<xsl:text>10pt</xsl:text>
</xsl:when>
<xsl:when test="@size = '3'">
<xsl:text>12pt</xsl:text>
</xsl:when>
<xsl:when test="@size = '4'">
<xsl:text>14pt</xsl:text>
</xsl:when>
<xsl:when test="@size = '5'">
<xsl:text>18pt</xsl:text>
</xsl:when>
<xsl:when test="@size = '6'">
<xsl:text>24pt</xsl:text>
</xsl:when>
<xsl:when test="@size = '7'">
<xsl:text>36pt</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>12pt</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>inherited-property-value(font-size)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<fo:inline font-size="{$size}" font-family="{$face}" color="{$color}">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
<xsl:with-param name="fileName">
<xsl:value-of select="$fileName"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:inline>
</xsl:template>
<xsl:template match="style"/>
</xsl:stylesheet>

View File

@ -25,6 +25,9 @@
<author email="aheritier@apache.org">Arnaud Heritier</author>
</properties>
<body>
<release version="2.5.2-SNAPSHOT" date="in SVN">
<action dev="ltheussl" type="fix" issue="MPPDF-56">Add support for <code><![CDATA[<font>]]></code> and <code><![CDATA[<samp>]]></code> tags.</action>
</release>
<release version="2.5.1" date="2007-03-28">
<action dev="ltheussl" type="fix" issue="MPPDF-57">Unable to remove cover type and version.</action>
</release>