[cairo] cairo_surface_create_similar / create_similar for SVGSurface

Eric Holmberg eric at omnicurious.com
Tue Jul 1 19:53:12 PDT 2008


> # this fails when I tried to call the create_similar
> s = cairo.SVGSurface(strFileName + '.svg', 400, 400)
> 
> ctx = cairo.Context(s)
> 
> target  = ctx.get_target()
> layer0 = target.create_similar(cairo.CONTENT_COLOR_ALPHA, 400, 400)
> layer1 = target.create_similar(cairo.CONTENT_COLOR_ALPHA, 400, 400)


Instead of using the create_similar, I have just created new SVG surfaces and
that works fine.

layer0 = cairo.SVGSurface(strFileName + '-0.svg', 400, 400)
layer1 = cairo.SVGSurface(strFileName + '-1.svg', 400, 400)


I'll take a look at the cairo_svg_surface_create_for_stream approach as well so
I can at least cache the files in memory instead of writing them to temporary
disk files.

-Eric



More information about the cairo mailing list