[cairo] Ellipse stroke

Richard Copley rcopley at gmail.com
Fri Nov 17 08:31:39 UTC 2017

> I don't have a solution for drawing with a cairo arc and a wide line. If you
> want to draw wide curves though, you can use bezier points. Get some
> circular or elliptical points and then get the bezier points for them. Then
> draw the curve. This gives you a lot of flexibility with what you might want
> to draw. As an example, I have some clocks at
> https://github.com/cecashon/OrderedSetVelociRaptor/tree/master/Misc/CircularClocks
> Some start as circles but can be deformed into an ellipse. There are some
> wide lines and a few other circular shapes there also.

Very cool, thanks.

To achieve what I want in Cairo, I will have to replace the cairo_arc calls
with lower-level cairo_curve_to calls, after having analysed quite thoroughly
exactly what the final stroke is supposed to look like.

It's more fun in HTML5 Canvas -- it seems happy to draw any ellipse arc
(even if the minor semiaxis is zero, which is ruled out by the Cairo API.)
I confess I'm not sure exactly what shaped path HTML5 Canvas creates
for the strokes in the cases I illustrated.

To match the ease-of-use of HTML5 Canvas, I think a "cairo_ellipse" API
would be needed. (Ignore the naive suggestions in my OP, of course,
as they don't fit Cairo's path representation.)

More information about the cairo mailing list