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

Matt Dew matt at osource.org
Thu Dec 16 23:44:25 PST 2010


On Thu, Dec 16, 2010 at 3:48 PM, Alan Coopersmith
<alan.coopersmith at oracle.com> wrote:
> Gaetan Nadon wrote:
>> On Thu, 2010-12-16 at 11:27 -0800, Alan Coopersmith wrote:
>>> 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
>>
>> Confirmed. This new param line makes it no worse than it was without
>> fop.xsl. After that, I installed the unifont package. No change, as
>> expected, as I have not done the configuration you suggested yet. But at
>> least it did not break anything.
>>
>> Any reason not to add those 2 params in xorg.xsl? They would be
>> available to all docs at a lesser makefile complexity. I was surprised
>> xmlto would accept more than one -m option.
>
> I was thinking we only wanted them in fop generated documents, but it
> appears they have no effect on the html (and our CSS stylesheets should
> override anyway), and obviously can't affect the text, so there's no reason
> not to put them in xorg.xsl.   New patch to follow.
>

I'm able to get the Chinese characters to show up in the PDFs by
adding the Chinese font 'AR PL UMing CN' to the symbol.font.family.


<xsl:param name="body.font.family">DejaVu Serif</xsl:param>
<xsl:param name="symbol.font.family">Times,Symbol,GNU Unifont,AR PL
UMing CN</xsl:param>

Also,  lots of reading from
http://xmlgraphics.apache.org/fop/1.0/fonts.html, which says that
auto-detect should find all the fonts in the system. Below is my
fop_conf.xml file.
All the names in all languages look good.

------------------
<fop version="1.0">
<renderers>
   <renderer mime="application/pdf">
      <fonts>
         <!-- automatically detect operating system installed fonts -->
         <auto-detect/>
      </fonts>
   </renderer>
</renderers>
</fop>
-----------------

I'm not sure what happens if you don't have the chinese (arphic) fonts
installed.

Let me know if these don't fix work for you guys.
Matt


More information about the xorg-devel mailing list