Hi,
Pascal Sancho wrote:
> Hi,
> I use now JDK 1.6.0-06.
> DejaVu fonts work fine (using either 'DejaVuSans' or 'DejaVu Sans' value).
> ZapfDingbats in SVG gives me a '#' if I leave the stroke-text line commented
> in fop.xconf file.
> (I used latest FOP trunk, rev 650050).
> Note that this works fine for awt output.
> Pascal
Digging a bit further into this I get the following results:
On my Ubuntu system I’ve got a ‘Dingbats’ font, which is a clone of Zapf
Dingbats provided by URW. This font is available in Java through AWT, as
confirmed by the listing of all font families. When it is properly
configured in my fop.xconf file, I get it in the resulting PDF in both
cases:
- from the svg part, it is first picked up by Batik through AWT, then
retrieved by the FOP PDF transcoder through the config file;
- from the FO part, it is directly picked up by FOP through the config
file.
If I render the file with the AWT renderer, the behaviour is slightly
different since the FOP font configuration system is not used. Instead
AWT is used in both cases, and the Dingbats font is normally picked up
by AWT.
Conclusion: if you want to render into PDF an FO file that contains some
SVG with special characters, you have to make sure to choose a font
available in AWT /and/ configure it properly in fop.xconf. In this case:
1. Determine under which name the font is known by AWT:
$ java ListAvailableFontFamilies
...
DejaVu Sans
Dingbats
FreeSerif
...
2. I can use the Dingbats font, let’s configure it in the FOP font
system:
...
<font kerning="yes" embed-url="path/to/dingbats.pfb">
<font-triplet name="Dingbats" style="normal" weight="normal"/>
</font>
...
Note that the value of the ‘name’ attribute /must/ match the value
returned above by AWT, here ‘Dingbats’.
3. Use this name in the FO file:
<fo:block>
<fo:instream-foreign-object>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -1 56 28"
height="10mm" width="20mm">
<style type="text/css">
text { font-family: 'Dingbats' }
</style>
<text y="18" x="0">✄</text>
</svg>
</fo:instream-foreign-object>
</fo:block>
<fo:block font-family="Dingbats">✄</fo:block>
If you don’t have any ZapfDingbats-like font available through AWT, you
must use another font that contains a glyph for the required characters,
like Jeremias said (here I could also have used FreeSerif, for example).
I hope I’m clear,
Vincent
--
Vincent Hennebert Anyware Technologies
http://people.apache.org/~vhennebert http://www.anyware-tech.com
Apache FOP Committer FOP Development/Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]