[PATCH:xorg-docs] Add fop.xsl stylesheet to set fonts in ps & pdf output

Alan Coopersmith alan.coopersmith at oracle.com
Thu Dec 16 11:27:47 PST 2010


Gaetan Nadon wrote:
> On Wed, 2010-12-15 at 15:59 -0800, Alan Coopersmith wrote:
>> Since a number of documents, especially the credits section in the Release
>> Notes, use characters not found in the fop default base PostScript fonts,
>> add a stylesheet for the fop generated documents to use the free
>> DejaVu and
>> GNU Unifont fonts which cover a much wider range of characters.
>>
> It does not work for me.

Hmm, I thought from reading the docs that the fallback to Times was automatic,
but it appears it needs to be explicit, and has to be done in the Symbol entry
(fop uses the list of fonts in "symbol" for characters not found in the single
font listed in "body).    Does changing the symbol line to this help you?

  <xsl:param name="symbol.font.family">Times,Symbol,GNU Unifont</xsl:param>

I think that should make things for people without DejaVu or Unifont no worse
than the current defaults, unless their distro's fop packages have customized
defaults already.   (If Times isn't before Symbol, then the release notes get
amusingly, but mostly unreadably, translated into Greek characters.)

In order to get fop to find the fonts, I have in ~/.fop/fop.conf:
fop_exec_args="$fop_exec_args -c /home/alanc/.fop/fop-conf.xml"

and in /home/alanc/.fop/fop-conf.xml:

<?xml version="1.0"?>
<!-- NOTE: This is the version of the configuration -->
<fop version="1.0">
  <renderers>
    <renderer mime="application/pdf">
      <fonts>
         <!-- register all the fonts found in a directory -->
         <directory>/usr/share/fonts/TrueType/core/</directory>
         <directory>/usr/share/fonts/TrueType/dejavu/</directory>
         <directory>/usr/share/fonts/TrueType/liberation/</directory>
         <directory>/usr/share/fonts/TrueType/unifont/</directory>

         <!-- automatically detect operating system installed fonts -->
         <auto-detect/>
      </fonts>
    </renderer>

    <renderer mime="application/postscript">
         <directory>/usr/share/fonts/X11/Type1/</directory>
         <directory>/usr/share/ghostscript/fonts/</directory>
         <directory>/usr/share/fonts/TrueType/core/</directory>
         <directory>/usr/share/fonts/TrueType/dejavu/</directory>
         <directory>/usr/share/fonts/TrueType/liberation/</directory>
         <directory>/usr/share/fonts/TrueType/unifont/</directory>
    </renderer>

</renderers>
</fop>

Of course paths would be distro-specific.

> Without the patch, I notice in the credits
> section the first name, which is composed of oriental characters, is
> represented with # character.

Right - that one, and a bunch of names with characters outside the
Western European/ISO Latin-1 character set (such as Arkadiusz Mi#kiewicz
instead of Arkadiusz Miśkiewicz) are the ones I was trying to stop mangling.

That's pretty much the last thing I want to fix before calling the 7.6 docs
done and shipping them, which is in turn the last set of modules to release
before calling the 7.6 katamari done.

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list