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 Phillip Rhodes <rh...@telerama.com> on 2002/09/06 07:56:25 UTC

external graphic fonts look really bad?

I have a chart that I am outputting in jpg, svg and png that I add to fo 
using external graphic.

No matter what format, the text in the image does not look very good.  It 
loses quality when added to the pdf.  While I can view the files via my 
servlet, they don't look nearly as bad as when they get into the pdf.

Any suggestions on how to improve the quality, or what format to use?

Thanks!


Re: external graphic fonts look really bad?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Michael Ivancsics wrote:
> Why do you mention "Arial" as default PDF font?
> As far as I know, Helvetica is the default font and Arial (looking similar,
> but not the same) is a truetype font...
Arial is listed as alias name for the default sans-serif
font (PDF spec, pg. 795). Just in case.

J.Pietschmann



Re: external graphic fonts look really bad?

Posted by Michael Ivancsics <mi...@ivancsics.co.at>.
Why do you mention "Arial" as default PDF font?
As far as I know, Helvetica is the default font and Arial (looking similar,
but not the same) is a truetype font...
M. Ivancsics

----- Original Message -----
From: "J.Pietschmann" <j3...@yahoo.de>
To: <fo...@xml.apache.org>
Sent: Friday, September 06, 2002 9:22 PM
Subject: Re: external graphic fonts look really bad?


> rhodespc@telerama.com wrote:
> >>From my reading, batik is using the Java fonts.  Since the same SVG
looks
> > pretty good in IE, but bad in the PDF, it's the SVG renderer, which in
> > this case is batik.
>
> Ah, this is easy: Batik renders text into shapes,
> which looks ugly. You should have said that *only*
> the text looks bad.
> You can attempt to put SVG text as text into the PDF
> by setting strokeSVGText to false:
>   http://marc.theaimsgroup.com/?l=fop-user&m=101600592228727&w=2
> You'd better stick to one of the default PDF fonts
> (Arial/Helvetica, Times Roman, Courier) and to
> ASCII text if you don't want to run into a variety
> of problems.
>
>
> J.Pietschmann
>


Re: external graphic fonts look really bad?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
rhodespc@telerama.com wrote:
>>>From my reading, batik is using the Java fonts.  Since the same SVG looks
> pretty good in IE, but bad in the PDF, it's the SVG renderer, which in
> this case is batik.

Ah, this is easy: Batik renders text into shapes,
which looks ugly. You should have said that *only*
the text looks bad.
You can attempt to put SVG text as text into the PDF
by setting strokeSVGText to false:
  http://marc.theaimsgroup.com/?l=fop-user&m=101600592228727&w=2
You'd better stick to one of the default PDF fonts
(Arial/Helvetica, Times Roman, Courier) and to
ASCII text if you don't want to run into a variety
of problems.


J.Pietschmann


Re: external graphic fonts look really bad?

Posted by rh...@telerama.com.
I am only specifying the width attribute for my external graphic object.
So I don't think it is getting wrapped in that aspect.

Since I am using SVG format, I don't think it is resolution.  SVG is
resolution independent.  Resolution may be a factor in the other formats.

>From my reading, batik is using the Java fonts.  Since the same SVG looks
pretty good in IE, but bad in the PDF, it's the SVG renderer, which in
this case is batik.

I will have to delve deeper into batik's usage of fonts when it renders
SVG.

One question, what do you think if I made a PNG file that was very big and
scaled it down, perhaps the resolution would be good.

I did try this, and did make my image very big, but specifying a width
would only clip the image, it did not scale it.  It scaling supported in
external graphic?  I read somewhere that it was not.


On Fri, 6 Sep 2002, J.Pietschmann wrote:

> Roland Neilands wrote:
> >>No matter what format, the text in the image does not look
> >>very good.  It
> >>loses quality when added to the pdf.  While I can view the
> >>files via my
> >>servlet, they don't look nearly as bad as when they get into the pdf.
> >>
> >>Any suggestions on how to improve the quality, or what format to use?
> > 
> > 
> > I bet you're resizing or stretching the image: this always screws up fonts
> > in images. Are the images the same size as the ones displayed? Set height &
> > width on the block-container instead of external-graphic to avoid this
> > (image must be smaller than this size).
> 
> That's not necessarily good advice, one reason being that
> not every one puts external graphics in fo:block-containers,
> and heigth is not implemented for ordinary blocks. In most
> cases it *is* a good idea to use height and/or width on the
> fo:external-graphics element. Also, if only one of height
> and width is specified, the aspect ratio is kept after scaling,
> the image is stretched only if both measurements are present.
> 
>  From the description I guess the image has just not enough
> resolution, which may result in blockiness and perhaps
> resampling artefacts. Printers usually have resolutions of
> 600dpi or 720 dpi, while even hi-res screens are around 100
> to 150 dpi. A 72 dpi image still looks good on a typical
> screen, and it usually looks like a "pixel image" on a
> printout.
> Text in images can be especially delicate unless proper
> anti-aliasing and smoothing is used while rendering the image,
> because of the contrast with the regularly printend text.
> 
> J.Pietschmann
> 
> 


Re: external graphic fonts look really bad?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Roland Neilands wrote:
>>No matter what format, the text in the image does not look
>>very good.  It
>>loses quality when added to the pdf.  While I can view the
>>files via my
>>servlet, they don't look nearly as bad as when they get into the pdf.
>>
>>Any suggestions on how to improve the quality, or what format to use?
> 
> 
> I bet you're resizing or stretching the image: this always screws up fonts
> in images. Are the images the same size as the ones displayed? Set height &
> width on the block-container instead of external-graphic to avoid this
> (image must be smaller than this size).

That's not necessarily good advice, one reason being that
not every one puts external graphics in fo:block-containers,
and heigth is not implemented for ordinary blocks. In most
cases it *is* a good idea to use height and/or width on the
fo:external-graphics element. Also, if only one of height
and width is specified, the aspect ratio is kept after scaling,
the image is stretched only if both measurements are present.

 From the description I guess the image has just not enough
resolution, which may result in blockiness and perhaps
resampling artefacts. Printers usually have resolutions of
600dpi or 720 dpi, while even hi-res screens are around 100
to 150 dpi. A 72 dpi image still looks good on a typical
screen, and it usually looks like a "pixel image" on a
printout.
Text in images can be especially delicate unless proper
anti-aliasing and smoothing is used while rendering the image,
because of the contrast with the regularly printend text.

J.Pietschmann


RE: external graphic fonts look really bad?

Posted by Roland Neilands <rn...@pulsemining.com.au>.
> No matter what format, the text in the image does not look
> very good.  It
> loses quality when added to the pdf.  While I can view the
> files via my
> servlet, they don't look nearly as bad as when they get into the pdf.
>
> Any suggestions on how to improve the quality, or what format to use?

I bet you're resizing or stretching the image: this always screws up fonts
in images. Are the images the same size as the ones displayed? Set height &
width on the block-container instead of external-graphic to avoid this
(image must be smaller than this size).

Cheers,
Roland