You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by David Moles <da...@vykor.com> on 2002/10/10 23:44:29 UTC

Special characters in PrintRenderer, AWT, PS, PDF.

Hi there. I'm generating an FO document that contains an em dash
(Unicode 0x2014). It renders fine to PDF, but in print and the
AWT viewer I get an "unknown character" box, and in PS I get a
blank space.

Is there a trick (in terms of remapping characters in fonts or
something) that the PDF renderer is doing that the others aren't,
and if there is, could someone point me to the code I'd want to
look at to try to patch the others to do the same thing?

Or is it just a matter of PDF using smarter fonts?

--David



Re: Special characters in PrintRenderer, AWT, PS, PDF.

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Guy D'haenens wrote:
> I got exactly the same problem a while ago. I tested and tried every
> possible trick I could find. Nothing helped. So I posted a message with
> examples and screen shots to the fop-user group.
...
> That I did. And it works in my JAVA program. So the problem is with FOP.

It's not easy to decide where the real problem is. The characters
are passed correctly to the Graphics.drawString() function.
However, the default FOP font is mapped to an AWT font with the
name SansSerif, which is apparently mapped onto a platform specific
font with which doesn't have a glyph for the em dash or most other
non ISO-8859-1 characters (tested on WinNT/Win2k).
The em dash can be displayed by the default PDF fonts, which are
built-in into FOP, therefore it always works with PDF.

The following works for both PDF and AWT:
- Select a Unicode font installed on the system with the required
   glyphs, for example Arial on Win2k/WinXP (for em dash)
- create a font metrics file and declare the font in a config
   file
- use the font instead of one of the built-in fonts
The drawback is that if the FO should be used for both PDF and
AWT rendering, the PDF is bloated by embedding the font.

I suspect the problem with PostScript is the same, however,
a TTF font is probably useless here.

J.Pietschmann


Re: Special characters in PrintRenderer, AWT, PS, PDF.

Posted by Guy D'haenens <gu...@xplanation.com>.
Hi David,
I got exactly the same problem a while ago. I tested and tried every
possible trick I could find. Nothing helped. So I posted a message with
examples and screen shots to the fop-user group.
I received the following answer from J. Pietschmann:

Well, can you do a little bit of Java programming?
First, create a small program which creates a frame and inserts a
label with some of the problematic characters. You can use
arbitrary Unicode characters in a string if you write them
as \u1E80, \u1E81 etc.
If this works, the problem is with FOP, otherwise it's a problem
with your JDK.
Second task: try to print teh same string.

That I did. And it works in my JAVA program. So the problem is with FOP.
DAMN. Next week I'm gonna try to fix this myself - locally.
I'm not sure I'll succeed - but at least I can try.
Cheers,
Guy


----- Original Message -----
From: "David Moles" <da...@vykor.com>
To: <fo...@xml.apache.org>
Sent: Thursday, October 10, 2002 11:44 PM
Subject: Special characters in PrintRenderer, AWT, PS, PDF.


> Hi there. I'm generating an FO document that contains an em dash
> (Unicode 0x2014). It renders fine to PDF, but in print and the
> AWT viewer I get an "unknown character" box, and in PS I get a
> blank space.
>
> Is there a trick (in terms of remapping characters in fonts or
> something) that the PDF renderer is doing that the others aren't,
> and if there is, could someone point me to the code I'd want to
> look at to try to patch the others to do the same thing?
>
> Or is it just a matter of PDF using smarter fonts?
>
> --David
>