XMLmind DITA Converter (ditac) generates XSL-FO files exclusively using
generic font families (serif, sans-serif, monospace).

This can be changed by customizing the XSLT stylesheets in the simplest
manner by redefining the following attribute-sets.

---
<xsl:attribute-set name="base-style">
  <xsl:attribute name="font-family">serif</xsl:attribute>
  <xsl:attribute name="font-size" select="$base-font-size"/>
  <xsl:attribute name="line-height">1.2</xsl:attribute>
  <xsl:attribute name="text-align"
                select="if ($justified = 'yes')
                        then 'justify' else 'left'"/>
</xsl:attribute-set>

<xsl:attribute-set name="monospace-style">
  <xsl:attribute name="font-family">monospace</xsl:attribute>
  <xsl:attribute name="font-size">90%</xsl:attribute>
</xsl:attribute-set>

<xsl:attribute-set name="title" use-attribute-sets="block-style">
  <xsl:attribute name="hyphenate">false</xsl:attribute>
  <xsl:attribute name="font-family">sans-serif</xsl:attribute>
  <xsl:attribute name="font-weight">bold</xsl:attribute>
  <xsl:attribute name="text-align">left</xsl:attribute>
  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
</xsl:attribute-set>

  <xsl:attribute-set name="note-label">
    <xsl:attribute name="font-family">sans-serif</xsl:attribute>
    <xsl:attribute name="font-weight">bold</xsl:attribute>
    <xsl:attribute name="text-align">left</xsl:attribute>
    <xsl:attribute name="hyphenate">false</xsl:attribute>
    <xsl:attribute name="padding">0.2em</xsl:attribute>
  </xsl:attribute-set>

  <xsl:attribute-set name="tabular-dl-head-row">
    <xsl:attribute name="font-family">sans-serif</xsl:attribute>
    <xsl:attribute name="font-weight">bold</xsl:attribute>
    <xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
    <xsl:attribute name="border-bottom">0.5pt solid #C0C0C0</xsl:attribute>
  </xsl:attribute-set>

<xsl:attribute-set name="document-title"
                   use-attribute-sets="title-page-block-style">
  <xsl:attribute name="font-family">sans-serif</xsl:attribute>
  <xsl:attribute name="font-weight">bold</xsl:attribute>
  <xsl:attribute name="font-size">200%</xsl:attribute>
</xsl:attribute-set>

  <xsl:attribute-set name="booktitlealt"
                     use-attribute-sets="title-page-block-style">
    <xsl:attribute name="font-family">sans-serif</xsl:attribute>
    <xsl:attribute name="font-style">italic</xsl:attribute>
    <xsl:attribute name="font-size">120%</xsl:attribute>
  </xsl:attribute-set>

  <xsl:attribute-set name="emailaddress" use-attribute-sets="link-style">
    <xsl:attribute name="font-family">monospace</xsl:attribute>
    <xsl:attribute name="font-size">90%</xsl:attribute>
  </xsl:attribute-set>

<xsl:attribute-set name="tabular-header">
  <xsl:attribute name="hyphenate">false</xsl:attribute>
  <xsl:attribute name="font-family">sans-serif</xsl:attribute>
  <xsl:attribute name="font-size">70%</xsl:attribute>
  <xsl:attribute name="color">#404040</xsl:attribute>
  <xsl:attribute name="border-color">#404040</xsl:attribute>
  <xsl:attribute name="border-width">0.25pt</xsl:attribute>
</xsl:attribute-set>
---

How to do this is explained here:
http://www.xmlmind.com/ditac/_distrib/doc/manual/manual-6.html#customAttributeSet



--> Now, we fully agree with your request about more control over the
fonts. We have *already* implemented the following feature in XMLmind
XSL-FO Converter v4.4 (to be released in a couple of weeks):

* By default, the generic font families are now mapped to "Times New
Roman", Arial and "Courier New". Previously the mapping was: Helvetica,
Times and Courier.

* The Java[tm] API of XMLmind XSL-FO Converter and also a command-line
option allows to easily change this mapping (in case, you don't like
"Times New Roman", Arial and "Courier New").



Douglas W Philips wrote:
>    We recently ran into a problem with Word having to do with the fonts
> that ditac and xfc were using to generate .docx files.
>    Our issue is that when we ask Word to save the .docx file as PDF, how
> it treats the fonts depends on which fonts are installed on the users
> system. It seems that ditac's conversion from .xml (DITA) files to .fo
> files uses font family "serif" and "sans-serif" and that the FO->docx
> converter changes those to Times and Helvetica. For why this is an
> issue, see the P.S.
> 
>    According to
> http://www.xmlmind.com/ditac/_distrib/doc/manual/xsltParams.html we can
> change the base-font-size but we cannot control what fonts are being
> used in the final docx file.
> 
>    I was able to work around our problem by changing the FO xsl files so
> that every mention of serif became TimesNewRoman and every mention of
> sans-serif became Arial, but that just feels wrong; With a 100 page
> document I haven't yet gone over it closely to make sure nothing else
> was affected and I don't really understand the implications of that change.
> 
>    We'd like to have options, similar to base-font-size, that would let
> us control the fonts used. Or maybe we've overlooked an option that does
> that?
> 
> 
> P.S. Why this matters to us:
> We are using Word to generate PDF files, and how Word does that depends
> on what fonts it has available.
> 
> On most of our Windows systems, there is no Times font installed, so the
> registry font substitution is used to translate Times to Times New
> Roman. On those systems, the PDF is generated correctly.
> 
> On my system, I have a printer driver installed which has a Times
> PostScript font. This means Word will not use the registry font
> substitution and instead will generate a PDF full of images of the text
> (which are not searchable in Acrobat Reader).
> 
> We are using Word to generate PDF only because we want to be able to
> take two different versions of our DITA documents, as .docx files and
> use Word to generate a merged "what changed" document. (Our downstream
> users do not want to see raw DITA diffs.)
> 
> We feel asking for control over the fonts used would be reasonable even
> if we weren't having issues generating PDF, but this has become a
> critical issue for us. Right now we can have someone with a "safe"
> system do this, but that isn't sustainable...
> 
> 



 
--
XMLmind FO Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xfc-support

Reply via email to