Re: [xep-support] Font problems (3.8)

From: Alexei Gagarinov <agagarinov@renderx.com>
Date: Fri Nov 26 2004 - 05:09:25 PST

Hello Stijn,

SE> the italics and bolds of Arial stay romans in the pdf

The excerpt from your XML file contains the EMPH attribute which value is
BOLD. XSLT converts the EMPH attribute to 'font-weight' (or 'font-style')
with the same value. But 'font-weight' attribute cannot be 'BOLD' according
to XSL-FO spec. It should be 'bold' instead.
BTW, XEP by default validates an input source and so you should to have seen
this error. Please check that the validation is turn on.

SE> the font Century Gothic doesn't even come out at all

According to the algorthm that XEP 3.8 uses to look up for fonts in
fonts.xml, the font records for the Century Gothic should include the
following aliases:

   <font name="Century Gothic"
         ttf="C:\WINNT\Fonts\gothic.ttf"
         embed="true">
      <alias name="CenturyGothic"/>
   </font>
   <font name="Century Gothic Bold"
         ttf="C:\WINNT\Fonts\gothicb.ttf"
         embed="true">
      <alias name="CenturyGothic-Bold"/>
   </font>
   <font name="Century Gothic Italic"
         ttf="C:\WINNT\Fonts\gothici.ttf"
         embed="true">
      <alias name="CenturyGothic-Italic"/>
   </font>
   <font name="Century Gothic Bold Italic"
         ttf="C:\WINNT\Fonts\gothicbi.ttf"
         embed="true">
      <alias name="CenturyGothic-BoldItalic"/>
   </font>

For details, see XEP 3.8 User Guide, 5.4 Configuring font families.

SE> 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?

'font-weight' (='bold') and 'font-style' (='italic') are just attributes. In
order to obtain an output document with the bold/italic text you need the
real glyphs, i.e. those fonts.

With best regards,
  Alexei Gagarinov
RenderX

----- Original Message -----
From: "Stijn Elst" <stijn@fotek.com>
To: <xep-support@renderx.com>
Sent: Thursday, November 25, 2004 7:19 PM
Subject: [xep-support] Font problems (3.8)

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 Fri Nov 26 05:39:48 2004

This archive was generated by hypermail 2.1.8 : Fri Nov 26 2004 - 05:39:48 PST