]> granicus.if.org Git - docbook-dsssl/commitdiff
Added new inline.sansseq template for consistency reasons.
authorThomas Schraitle <tom_schr@web.de>
Sun, 28 Oct 2012 18:05:18 +0000 (18:05 +0000)
committerThomas Schraitle <tom_schr@web.de>
Sun, 28 Oct 2012 18:05:18 +0000 (18:05 +0000)
Makes it easier for customization layers: Just use
  <xsl:call-template name="inline.sansseq"/>
to change to sans serif font, but also takes into account
XLinks and direction of text.

xsl/fo/inline.xsl

index 290226b3b84a203cc038ea2854adf32b5dfbe7a9..8fe1759d9aec4c839ab2809d94fd9e28feb2f75c 100644 (file)
       <xsl:copy-of select="$content"/>
     </xsl:otherwise>
   </xsl:choose>
+</xsl:template>
 
+<xsl:template name="inline.sansseq">
+  <xsl:param name="content">
+    <xsl:call-template name="simple.xlink">
+        <xsl:with-param name="content">
+          <xsl:apply-templates/>
+        </xsl:with-param>
+    </xsl:call-template>
+  </xsl:param>
+
+  <fo:inline font-family="{$sans.font.family}">
+    <xsl:choose>
+    <xsl:when test="@dir">
+      <fo:inline>
+        <xsl:attribute name="direction">
+          <xsl:choose>
+            <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
+            <xsl:otherwise>rtl</xsl:otherwise>
+          </xsl:choose>
+        </xsl:attribute>
+        <xsl:copy-of select="$content"/>
+      </fo:inline>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy-of select="$content"/>
+    </xsl:otherwise>
+  </fo:inline>
 </xsl:template>
 
 <xsl:template name="inline.charseq">