[cairo] cairo backend for xpdf - first drop

Kristian Høgsberg krh at bitplanet.net
Tue Dec 21 15:20:13 PST 2004

Carl Worth wrote:
> On Mon, 20 Dec 2004 19:54:12 +0100, Alexander Larsson wrote:
>>I found an embarrasing bug in it. It kept reading the fonts over and
>>over again. With that fixed, and with all the performance fixes in Cairo
>>cvs xpdf-cairo now feels faster than the standard xpdf on my machine.
>>I'm attaching the new patch.
> Alexander,
> This is fantastic work. I think I may have found a new favorite PDF
> viewer.
> The rendering of the glyphs is so much nicer compared to standard
> xpdf. Though I notice that the improved hinting allows some extra room
> in which the intra-word spacing could be improved. To my eye,
> intra-word problems, (such as two adjacent letters colliding) stand
> out more with the hinting of xdpf-cairo, whereas with xpdf-standard
> the words are just blurry everywhere.
> Do you generally still have word structure available in PDF files? Or
> is every glyph already placed individually?

You can show entire words and lines with one drawing command, and there 
is an operator that allows you to specify horizontal offsets relative to 
the position computed from the glyph metrics for each glyph.  However, I 
believe the PDF interpreter is required to respect the glyph metrics 
provided with the font.

> Meanwhile, line art appears to have better snapping with
> xpdf-standard, (or more likely that's just the lack of
> antialiasing). I've been meaning to propose a cairo_set_snapping API
> for some time and I think this application gives us perfect
> justification and some great test cases for that.

I discussed this with Alex in IRC and for strokes, the PDF document can 
specify that they should be pixel aligned.  Otherwise the spec 
explicitly states that coordinates should not be rounded to device 
space.  Still, snapping could be an option that could be toggled.


More information about the cairo mailing list