[cairo] more svg to cairo stuff

Donn donn.ingle at gmail.com
Wed Nov 7 12:31:37 PST 2007


> Somehow I don't see the problem ;)
Ah, but you have a brain. I took one look at that string and I think part of 
me is still screaming :)

> These are the operators:
> M is a "moveto" operator, which has two floating point operands
> C is a "curveto" operator, which has six floating point operands
> Z is a closepath operator without operands
Put that way, I see a real glimmer of hope.

> A moveto matches to cairo_moveto (resp its equivalent in the Python
> binding), curveto matches to cairo_curveto, closepath to cairo_close_path
> There exist a couple more operators in the SVG spec, but these are the most
> interesting.
Bingo. I'm on it.

> After you have built the path, you may render it. In SVG here apply the
> stroke and fill attributes, with match cairo_fill and cairo_stroke.
> The interesting part is to extract the information about how to draw (i.e.
> using a solid colour, a pattern, a gradient or whatever). This may get a
> little tricky, and potentially complex, if you have descend to e.g. CSS
> styles.
For now, I'm gonna skip all that stuff.

Thanks!

\d


More information about the cairo mailing list