[cairo] Custom logical / inked rect for PangoRenderer subclass?

Peter Clifton pcjc2 at cam.ac.uk
Mon Dec 22 09:19:54 PST 2008


Hi,

Another noob-pango-user question I'm afraid..

I've got a custom PangoRenderer which adds an attribute for drawing
overbars on some text in CAD drawings. What concerns me now is that I
need an accurate way to measure the text for invalidating on-screen
regions, and recording just were the text objects are on our canvas (so
we know what to repaint when we get an expose event).

It wasn't obvious to me that I could provide new information for the
inked / logical rectangles retrieved with 
pango_layout_get_extents() or pango_layout_get_pixel_extents().

For now, it seems to work, since I'm (mostly by luck) keeping the
overbars inside the logical extents of the rendered text.

Is it always the case that the logical extents are the same or larger
than the inked extents? (Or is it possible that inked extents exceed
logical extents?). For now, I'm basically just invalidating the logical
extents.

Behdad, you mentioned bug #457990 before.. is pango_layout_get_extents()
affected by that bug? I'm having difficulty getting sensible bounds from
that when I have a non identity CTM. Setting cairo_set_font_matrix ()
with my world to device scaling factors didn't seem to affect its output
either.

Best regards,

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



More information about the cairo mailing list