[cairo] cairo-pdf glyph positioning bug with librsvg

Behdad Esfahbod behdad at behdad.org
Thu Feb 21 17:42:39 PST 2008

On Mon, 2008-02-18 at 09:24 +0100, Emmanuel Pacaud wrote:
> Le dimanche 17 février 2008 à 20:32 -0500, Behdad Esfahbod a écrit :
> > Ok, I've got a patch that mostly fixes this now.  The bug was simple:
> > librsvg's Pango use was a mess.
> Text rendering is the weakest part of librsvg (which is not surprising
> since it's also the hardest part to implement...).

Fully implementing all the attributes and features, yes, it's indeed

> >   - librsvg also was using the ink extents in some places where logical
> > extents should be used.  Fixed in the patch.
> That's something I'm interrested in. I'm currently implementing a
> pango/cairo based mathml renderer, and I'm not really confident in my
> use of the pango API. I guess I've not fully understood the difference
> between logical and ink extents, and how to use them when you have to
> manually position several pango layout in a single row. The pango
> documentation lacks some explanation regarding extents.

I've wanted to fix the docs for a while, here is where to follow:


In short, think of ink extents as cairo path extents, the tight bounding
box of all the ink involved.  Logical extents on the other hand are the
logical boundary.  A space character for example has 0,0,0,0 ink rect,
but its logical extents have a width of a single space, and the
ascent/decent of the current font.  Hope that helps.

Re MathML rendering, I'm interested to hear more about it.  There's this
new OpenType MATH table that should help with positioning.  I have plans
to include that in HarfBuzz at some point.  Having a user lined up
helps :).  Gecko uses pango to render MathML already, and I think there
a GTK+ widget floating around the net too.  I'm sure you know about

> 	Emmanuel.


"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

More information about the cairo mailing list