diff options
Diffstat (limited to 'src/codegen/font-file.xsl')
-rw-r--r-- | src/codegen/font-file.xsl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/codegen/font-file.xsl b/src/codegen/font-file.xsl index 3c2f5ee8f..902be25f6 100644 --- a/src/codegen/font-file.xsl +++ b/src/codegen/font-file.xsl @@ -14,6 +14,10 @@ file charlist.xml and extracts the WinAnsi code. extension-element-prefixes="redirect"> <xsl:output method="text" /> +<!-- note that match in xsl:key doesn't like document('charlist.xml'), so the charlist + must be merged with the source xml at build time by the Xslt task --> +<xsl:key name="adobe-char-map" match="/font-metrics/font-mappings/map" use="@adobe-name"/> + <xsl:template match="font-metrics"> <xsl:variable name="class-name" select="class-name"/> <!--<redirect:write select="concat('org/apache/fop/render/pdf/fonts/', $class-name, '.java')">--> @@ -34,7 +38,7 @@ public class <xsl:value-of select="class-name"/> extends Font { static { width = new int[256]; -<xsl:for-each select="widths/char"><xsl:variable name="char-name" select="@name"/><xsl:variable name="char-num" select="document('charlist.xml')/font-mappings/map[@adobe-name=$char-name]/@win-ansi"/><xsl:if test="$char-num!='-1'"> width[<xsl:value-of select="$char-num"/>] = <xsl:value-of select="@width"/>; +<xsl:for-each select="widths/char"><xsl:variable name="char-name" select="@name"/><xsl:variable name="char-num" select="key('adobe-char-map',$char-name)/@win-ansi"/><xsl:if test="$char-num!='-1'"> width[<xsl:value-of select="$char-num"/>] = <xsl:value-of select="@width"/>; </xsl:if></xsl:for-each> } |