W3C home > Mailing lists > Public > www-xsl-fo@w3.org > April 2006

FOP and font problem (newbie)

From: Ken Beesley <ken.beesley@xrce.xerox.com>
Date: Fri, 14 Apr 2006 16:31:06 +0200
Message-ID: <443FB22A.50806@xrce.xerox.com>
To: xsl-fo <www-xsl-fo@w3.org>

I recently installed fop 0.20.5 (on Linux) and used it successfully with
the built-in fonts.  My next step was to try to add and use
the Charis SIL font family, a Unicode font which is particularly
good for rendering any Roman or Cyrillic letter character with
one or more "combining diacritic marks".

So I converted CharisSILR.ttf, CharisSILB.ttf, CharisSILI.ttf,
and CharisSILBI.ttf to make .xml versions, and modified my
personal config.xml file to include

  <fonts>
    <font  metrics-file="/home/beesley/.fop/fonts/CharisSILR.xml"
           kerning="yes"
           embed-file="/home/beesley/.fonts/CharisSILR.ttf">
      <font-triplet name="Charis SIL" style="normal" weight="normal"/>
    </font>
    <font  metrics-file="/home/beesley/.fop/fonts/CharisSILB.xml"
           kerning="yes"
           embed-file="/home/beesley/.fonts/CharisSILB.ttf">
      <font-triplet name="Charis SIL" style="normal" weight="bold"/>
    </font>
    <font  metrics-file="/home/beesley/.fop/fonts/CharisSILI.xml"
           kerning="yes"
           embed-file="/home/beesley/.fonts/CharisSILI.ttf">
      <font-triplet name="Charis SIL" style="italic" weight="normal"/>
    </font>
    <font  metrics-file="/home/beesley/.fop/fonts/CharisSILBI.xml"
           kerning="yes"
           embed-file="/home/beesley/.fonts/CharisSILBI.ttf">
      <font-triplet name="Charis SIL" style="italic" weight="bold"/>
    </font>

In 0.20.5, the Charis SIL font is found and used.  In my FO source file,
I can specify them as, e.g.

            <fo:block font-family="Charis SIL" font-size="18pt" 
line-height="24pt" space-after.optimum="15pt" text-align="center" 
padding-top="3pt">Precomposed accented glyphs: Hopikwa Lavytutuveni  
    &#x00F6; </fo:block>

<fo:block font-family="Charis SIL" font-size="18pt" line-height="24pt" 
space-after.optimum="15pt" text-align="center" 
padding-top="3pt">Accented glyphs based on plain 'o' followed by a 
combining accent (grave, acute, circum, diaeresis): o&#x0300; o&#x0301; 
o&#x0302; o&#x0308;</fo:block>

            <fo:block font-family="Charis SIL" font-size="18pt" 
line-height="24pt" space-after.optimum="15pt" text-align="center" 
padding-top="3pt">Accented glyphs based on precomposed  (0x00F6) 
followed by a combining accent (grave, acute, circum): &#x00F6;&#x0300; 
&#x00F6;&#x0301; &#x00F6;&#x0302; </fo:block>


            <fo:block font-family="Charis SIL" font-size="18pt" 
line-height="24pt" space-after.optimum="15pt" text-align="center" 
padding-top="3pt">Accented glyphs based on plain 'o' followed by a 
combining diaeresis (0x0308) and another combining accent (grave, acute, 
circum): o&#x0308;&#x0300; o&#x0308;&#x0301; o&#x0308;&#x0302;</fo:block>

These new fonts are found and used.

************** Problems:

1.  The last three fo:block examples use Unicode Combining Diacritical
Marks, in particular &#x0300; (combining grave accent), &#x0301;
(combining acute accent), &#x0302; (combining circumflex accent)
and &#x0308; (combining diaeresis).

 From the second block, the PDF output shows good placement
of single combining diacritics over 'o'.

But in the final two blocks, the PDF output is bad.  E.g. a sequence
like o&#x0308;&#x0301; should be
rendered as an 'o', with a diaeresis on top of it, with an acute accent
on top of the diaeresis. 

In fact, with FOP the acute accent is overlaid incorrectly on the
diaeresis in the PDF output.  The acute accent should be rendered
higher up so that it doesn't clash with the diaeresis.

The Charis SIL font has Graphite and AAT information necessary
to place multiple accents correctly, but it looks like FOP doesn't
use that information.  XeTeX and some other applications can use
Charis SIL and display such combining-diacritic sequences correctly.

2.  I tried again using FOP 0.90alpha

With 0.90 (and using the same config.xml, .xml fonts, and source file)
I got the following error message:

fop-0.90 -c /home/beesley/.fop/config.xml -fo tryaccents.xml -pdf out2.pdf
Initializing User Agent Configuration
Font 'Charis SIL,normal,400' not found. Substituting with default font.

i.e. it complains that it can't find 'Charis SIL,normal,400'


3.  I then tried FOP 0.91beta (using the same config.xml, .xml fonts, and
source file) and got the following slightly different error message:

fop-beta  -c /home/beesley/.fop/config.xml -fo tryaccents.xml -pdf out3.pdf
Font 'SIL,normal,400' not found. Substituting with default font.

i.e. it complains that it can't find 'SIL,normal,400'

With both alpha and beta, the default font is indeed used, and the
output of combining diacritics is completely inacceptable.

******************* Questions:

What's going on here?

What am I doing wrong?

If it's not my fault, when might I expect a bug fix?

Thanks,

Ken
Received on Friday, 14 April 2006 20:50:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:13 GMT