[xep-support] Font problems (3.8)

From: Stijn Elst <stijn@fotek.com>
Date: Thu Nov 25 2004 - 08:19:00 PST

Hi all,

I'm having a problem with my fonts in XEP 3.8. I changed the fonts.xml file, eg. for Arial and Century Gothic:

   <font name="ArialMT"
         ttf="C:\WINNT\Fonts\arial.ttf"
         embed="true">
     <alias name="Arial"/>
   </font>

   <font name="Arial-BoldMT"
         ttf="C:\WINNT\Fonts\arialbd.ttf"
         embed="true">
     <alias name="Arial-Bold"/>
     <alias name="ArialMT-Bold"/>
   </font>

   <font name="Arial-ItalicMT"
         ttf="C:\WINNT\Fonts\ariali.ttf"
         embed="true">
     <alias name="Arial-Italic"/>
     <alias name="ArialMT-Italic"/>
   </font>

   <font name="Arial-BoldItalicMT"
         ttf="C:\WINNT\Fonts\arialbi.ttf"
         embed="true">
     <alias name="Arial-BoldItalic"/>
     <alias name="ArialMT-BoldItalic"/>
   </font>

   <font name="Century Gothic"
         ttf="C:\WINNT\Fonts\gothic.ttf"
         embed="true">
   </font>

   <font name="Century Gothic Bold"
         ttf="C:\WINNT\Fonts\gothicb.ttf"
         embed="true">
   </font>

   <font name="Century Gothic Italic"
         ttf="C:\WINNT\Fonts\gothici.ttf"
         embed="true">
   </font>

   <font name="Century Gothic Bold Italic"
         ttf="C:\WINNT\Fonts\gothicbi.ttf"
         embed="true">
   </font>

and the italics and bolds of Arial stay romans in the pdf. The font Century Gothic doesn't even come out at all!

The XML looks eg. like this: <TEXT LEFT="1063" TOP="1700" WIDTH="6377" HEIGHT="319" SIZE="24pt" FONT="Arial" COLOR="000000" EMPH="BOLD" HALIGN="LEFT">Arial B</TEXT>

And here's the match rule in my XSL-FO:

 <xsl:template match="TEXT">
  <fo:block-container absolute-position="absolute">
   <xsl:attribute name="top"><xsl:value-of select="@TOP" /></xsl:attribute>
   <xsl:attribute name="left"><xsl:value-of select="@LEFT" /></xsl:attribute>
   <xsl:attribute name="width"><xsl:value-of select="@WIDTH" /></xsl:attribute>
   <xsl:attribute name="height"><xsl:value-of select="@HEIGHT" /></xsl:attribute>
   <fo:block>

    <!-- horizontal alignment-->
    <xsl:if test='not(@HALIGN)'>
     <xsl:attribute name="text-align">center</xsl:attribute>
    </xsl:if>
    <xsl:if test='@HALIGN'>
     <xsl:if test='@HALIGN=""'>
      <xsl:attribute name="text-align">center</xsl:attribute>
     </xsl:if>
     <xsl:if test='not(@HALIGN="")'>
      <xsl:attribute name="text-align"><xsl:value-of select="@HALIGN" /></xsl:attribute>
     </xsl:if>
    </xsl:if>

    <!-- text size -->
    <xsl:if test='@SIZE'>
     <xsl:if test='@SIZE=""'>
      <xsl:attribute name="font-size">12pt</xsl:attribute>
     </xsl:if>
     <xsl:if test='not(@SIZE="")'>
      <xsl:attribute name="font-size"><xsl:value-of select="@SIZE" /></xsl:attribute>
     </xsl:if>
    </xsl:if>
    <xsl:if test='not(@SIZE)'>
     <xsl:attribute name="font-size">12pt</xsl:attribute>
    </xsl:if>

    <!-- text font -->
    <xsl:if test='@FONT'>
     <xsl:if test='@FONT=""'>
      <xsl:attribute name="font-family">Times</xsl:attribute>
     </xsl:if>
     <xsl:if test='not(@FONT="")'>
      <xsl:attribute name="font-family"><xsl:value-of select="@FONT" /></xsl:attribute>
     </xsl:if>
    </xsl:if>
    <xsl:if test='not(@FONT)'>
     <xsl:attribute name="font-family">Times</xsl:attribute>
    </xsl:if>

    <!-- text color -->
    <xsl:if test='@COLOR'>
     <xsl:if test='not(@COLOR="")'>
      <xsl:attribute name="color"><xsl:value-of select="@COLOR" /></xsl:attribute>
     </xsl:if>
    </xsl:if>

    <!-- text emphasis -->
    <xsl:if test='@EMPH'>
     <xsl:if test='@EMPH="ITALIC"'>
      <xsl:attribute name="font-style"><xsl:value-of select="@EMPH" /></xsl:attribute>
     </xsl:if>
     <xsl:if test='@EMPH="BOLD"'>
      <xsl:attribute name="font-weight"><xsl:value-of select="@EMPH" /></xsl:attribute>
     </xsl:if>
     <xsl:if test='@EMPH="BOLDITALIC"'>
      <xsl:attribute name="font-weight">bold</xsl:attribute>
      <xsl:attribute name="font-style">italic</xsl:attribute>
     </xsl:if>
    </xsl:if>

    <xsl:apply-templates />
   </fo:block>
  </fo:block-container>
 </xsl:template>

What am I doing wrong? Any help would be greatly appreciated, thanks.

Another question is: if bold/italic can be done by means of emphasis in the XSL-FO, then why do I need to define the b/i/bi fonts in the fonts.xml file?

Sincerely,
Stijn Elst.

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html
Received on Thu Nov 25 09:12:04 2004

This archive was generated by hypermail 2.1.8 : Thu Nov 25 2004 - 09:12:05 PST