Don Hopkins wrote:
I could use some tips about measuring the bounding box of fonts and text
in cairo, please.
I gave up entirely on straight cairo text rendering and switched to
pango - which ended up looking something like this:
self.pango_context = self.create_pango_context()
self.layout = pango.Layout(self.pango_context)
fontDescription = pango.FontDescription("Monospace 8")
self.layout.set_font_description(fontDescription)
self.layout.set_text(text)
(self.pixel_width, self.pixel_height) = self.layout.get_pixel_size()
cairo_context.show_layout(self.layout)
- a
_______________________________________________
Sugar mailing list
[email protected]
http://mailman.laptop.org/mailman/listinfo/sugar