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 Gerdt <Dg...@bju.edu> on 2008/10/18 18:11:30 UTC

speed of different fonts for Java2D

Hi all-
 
I recently noticed that there is a marked speed difference between rendering time when use custom fonts and when I do not. If I run the transform in question with a stock 0.95 build and no configuration file given, it will produce the finished PCL (31 page document) file in about 33 seconds. Unfortunately, the fonts on my system (AIX 5.3, Java 1.4) have problems such that when I use a variety of character formatting (bold, italic, bold italic) specifying a default font like Times, the spacing between words of different formatting is completely wrong and unusable. I fixed this by providing my own ttf font files and the document looks great. Unfortunately, when I provide my own fonts, the rendering time goes up to nearly 3 minutes.
 
Anyone have any thoughts on why the rendering time is affected so drastically or what I might do to speed things up?
 
Thanks,
Dave

Re: speed of different fonts for Java2D

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
That's because text using custom fonts is drawn as bitmaps via Java2D.
This is documented at: http://xmlgraphics.apache.org/fop/0.95/output.html#pcl
This approach was a relatively cheap way to provide support for custom
fonts in the PCL renderer. During development of the PCL renderer I
noticed that even most PCL printer drivers on Windows actually paint
text that way. Unfortunately, this combination is relatively slow in
Java, especially if you don't paint the whole page that way, but only
certain regions. Maybe this can be improved somehow (Patches welcome).
The alternative to speed things up is to implement TrueType embedding
support for PCL output. But this looked insanely complicated in the case
of PCL. That's why I chose the bitmap approach.

I would suggest you investigate if you can use PostScript instead of PCL.

On 18.10.2008 18:11:30 David Gerdt wrote:
> Hi all-
>  
> I recently noticed that there is a marked speed difference between
> rendering time when use custom fonts and when I do not. If I run the
> transform in question with a stock 0.95 build and no configuration file
> given, it will produce the finished PCL (31 page document) file in
> about 33 seconds. Unfortunately, the fonts on my system (AIX 5.3, Java 1.4)
> have problems such that when I use a variety of character formatting
> (bold, italic, bold italic) specifying a default font like Times, the
> spacing between words of different formatting is completely wrong and
> unusable. I fixed this by providing my own ttf font files and the
> document looks great. Unfortunately, when I provide my own fonts, the
> rendering time goes up to nearly 3 minutes.
>  
> Anyone have any thoughts on why the rendering time is affected so
> drastically or what I might do to speed things up?
>  
> Thanks,
> Dave




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org