[cairo] cairo backend for xpdf - first drop

Alexander Larsson alexl at redhat.com
Mon Jan 10 01:14:44 PST 2005


On Wed, 2004-12-22 at 10:39 -0500, Carl Worth wrote:
> On Wed, 22 Dec 2004 09:08:29 +0100, Alexander Larsson wrote:
> > On Tue, 2004-12-21 at 16:40 -0500, Carl Worth wrote:
> > >
> > > Do you generally still have word structure available in PDF files? Or
> > > is every glyph already placed individually?
> > 
> > PDF documents are basically pre-layouted. You aren't really supposed to
> > modify the positioning of the glyphs.
> 
> While it's true that we're not supposed to modify the positioning, the
> fact is that we can't avoid this entirely since we have limited
> precision in our output display devices. So the question becomes how
> can those pixels best be used to represent the document.
> 
> Consider the two attached images, both captured from xpdf rendering
> the same document (PLRM.pdf). The text_unhinted image is from xpdf
> 3.00, while the text_hinted image is from xpdf with the cairo
> patches. Both versions link to freetype, so I assume the major
> difference between the two is that cairo asks freetype to do hinting.
> 
> In text_unhinted, the glyphs appear well-positioned, but blurry.
> 
> In text_hinted, the individual glyph shapes appear much more crisp and
> pleasing. But the positioning now appears wrong. The "an" and "ai"
> sequences are far too crowded, while there is excessive space among
> the "nd" and "id" sequences. The hinting process has moved some glyph
> elements slightly, and in some cases these errors add up to bad
> results. Notice that the stem of the 'i' moved slightly to the left
> while the curve of the 'd' moved to the right.
> 
> The net result is that in the case of "aid", after hinting there is
> now sufficient room to move the 'i' one pixel to the right. That would
> improve the appearance dramatically.
> 
> I don't think it would be inappropriate to make this kind of
> adjustment, (as it is meant to compensate for error already introduced
> by the hinting). This sort of adjustment could easily be limited to
> single-pixel adjustments of glyphs within a word I think.

I see. Yeah, this sounds like something you'd want to do.

> The question I had is whether xpdf has all the information it needs to
> be able to compute this adjustment. The answer may be "it depends on
> the document", but I would certainly like to see this happen when
> possible.

I have no idea...

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl at redhat.com    alla at lysator.liu.se 
He's a war-weary Republican cowboy who hangs with the wrong crowd. She's a 
beautiful hypochondriac lawyer who can talk to animals. They fight crime! 




More information about the cairo mailing list