Search code examples
xsltfontsdebianxsl-foapache-fop

FOUserAgent - Glyph "➜" (0x279c, a167) not available in font "Symbol"


I am trying to make sense of the following documentation. So here is my naive try:

$ cat custom.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>

<xsl:param name="symbol.font.family" select="'Symbol,ZapfDingbats,Lucida Sans Unicode'"/>
<xsl:template match="symbol[@role = 'symbolfont']">
  <fo:inline font-family="Symbol">
    <xsl:call-template name="inline.charseq"/>
  </fo:inline>
</xsl:template>

</xsl:stylesheet>

and the input docbook 5:

$ cat bla.xml
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<article xmlns="http://docbook.org/ns/docbook" version="5.0">
  <section>
    <title>title</title>
    <!--symbol role="symbolfont">➜</symbol--><!-- removed since not valid -->
    <para>before <symbol role="symbolfont">➜</symbol></para>
    <para><symbol role="symbolfont">➜</symbol> after</para>
    <para>➜</para>
  </section>
</article>

Which I compiled using:

$ xsltproc --nonet -o bla.fo custom.xsl bla.xml
Note: namesp. cut : stripped namespace before processing           title
Note: namesp. cut : processing stripped document                   title
Making portrait pages on USletter paper (8.5inx11in)
$ fop bla.fo bla.pdf
[WARN] FOUserAgent - Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400".
[WARN] FOUserAgent - Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400".
[WARN] FOUserAgent - Glyph "➜" (0x279c, a167) not available in font "Symbol".
[INFO] FOUserAgent - Rendered page #1.

Which leads to the following:

convert bla.pdf -crop 200x250+50+50  bla.png

So why is <para>➜</para> working in my case but not the others ?


Pay attention that this issue is closely related to Debian, since Debian does not ship Times fonts.


Solution

  • In fact that was pretty simply. I need to use ZapfDingbats instead:

    <xsl:template match="symbol[@role = 'symbolfont']">
      <fo:inline font-family="ZapfDingbats">
        <xsl:call-template name="inline.charseq"/>
      </fo:inline>
    </xsl:template>