As long as you stay with the Base 14 fonts (Helvetica, Times, Courier,
Symbol and ZapfDingbats) there are probably no problems. But as soon as
you try custom fonts you'll be disappointed. Java2D does not have the
capabilities we need/want for the quality of output we want to achieve.
For example, we can't extract original font data for font embedding out
of Java2D and the font metrics Java2D provides don't satisfy.

My suggestion to you would be to check if you can use GhostScript (GPL,
AFPL or commercial license) to convert PDF to TIFF.

What you could try is to somehow use our own font subsystem's font
metrics to drive glyph placement in Java2D, i.e. the exact opposite of
what you tried just now. IMO that has a better chance to meet your needs
if you can't use a PDF-to-TIFF conversion.

On 22.01.2007 02:34:50 Daniel Noll wrote:
> Hi all.
> 
> There is a requirement in our system where PDF and TIFF output must have 
> the same content on every page.  Because of this, we need to use 
> identical font metrics for these two renderers.
> 
> By default, the two render differently.  The widths of the fonts are 
> slightly different, so they wrap slightly differently, and once you have 
> one word wrapping to the next page, it cascades.
> 
> Anyway, I was thinking, why can't I just do this?
> 
>    private class MyPDFRenderer extends PDFRenderer {
>      public void setupFontInfo(FontInfo inFontInfo) {
>        // Code copied from Java2DRenderer
>        fontInfo = inFontInfo;
>        BufferedImage fontImage = new BufferedImage(100, 100,
>                                         BufferedImage.TYPE_INT_RGB);
>        Graphics2D g = fontImage.createGraphics();
>        g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
>                           RenderingHints.VALUE_FRACTIONALMETRICS_ON);
>        FontSetup.setup(fontInfo, g);
>      }
>    }
> 
> If I substitute this renderer in, then the PDF and TIFF outputs look 
> identical, and I can't see any noticeable problems with the PDF.  As an 
> added bonus, it means I don't even need the XML files hanging around, 
> which have been a pain to manage.
> 
> So what I want to know is, is there a drawback for performing this hack?
> 
> Daniel
> 


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to