[cairo] pango.Context from a cairo.ImageSurface ?

Dominic Lachowicz domlachowicz at gmail.com
Mon Feb 26 10:22:06 PST 2007

Hi Tobias,

Probably you want something similar to:

// given a cairo surface, create a cairo_t
cairo_create ()

// get default font map
pango_cairo_font_map_get_default ()

// create PangoContext, given a fontmap
pango_cairo_font_map_create_context ()

// sync pango context with cairo context
pango_cairo_update_context ()


It looks like you're not using C, but there should be equivalent calls
in whatever binding you're using.


On 2/26/07, Tobias Ceglarek <dev at ceglarek.eu> wrote:
> Hello,
> I need to get a pango.Context from a cairo.ImageSurface?
> More precisely: I want to produce a png image file with
> cairo.ImageSurface.write_to_png(). So I need a cairo.ImageSurface. But I
> need a pango.Context too, because I want to use pango to layout text
> comfortably.
> Is it possible?
> Regards,
> TC
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo

Counting bodies like sheep to the rhythm of the war drums.

More information about the cairo mailing list