[cairo] cairo internal design ideas

dirk.schoenberger at sz-online.de dirk.schoenberger at sz-online.de
Thu Sep 23 04:05:05 PDT 2004

> On Thu, 23 Sep 2004 dirk.schoenberger at sz-online.de wrote:
> Hello Dirk,
>> >   2 w                   % stroke width
>> >   0.3 0 0 RG            % fill colour
>> >   0 g                   % stroke colour
>> >   0 0 m                 % moveto bottom left
>> >   100 0 l               % bottom right
>> >   70 20  30 20  0 0 c   % arc, right, left, back to start.
>> >   b                     % closepath, then fill, then stroke
>> But this would mean that the set of "drawing primitives" in cairo should
>> be extended, no?
> No, ...With the possible exception of keeping 'arc' a high-level operator;
> Postscript and SVG both have arc facilities, whilst PDF does not.


> However, Postscript's' pathforall only handles moveto, lineto, curveto,
> closepath;  arc's unfortunately have to be approximated with curves.
>> Currently we have only moveto, curveto, lineto,
> This are the commands above:  m == moveto, l == lineto, c == curveto.

I know.

>> while e.g. the SVG operators (horizontal lineto, cubic bezier curve
>> segment and such, are "flattened" to the basic operators.
> Horizontal lineto should be flattened to lineto as you say;  it can be
> `unflattened' through analysis if needed.  Cubic Bezier is a native
> operator.  However, Postscript/PDF do not have a Quadratic Bezier operator
> (as used in Truetype fonts).

Currently I am separated from my documentation, so I mixed quadratic and
You are right.

>> From what I understood, the more high level operations are rather
>> different between the "Postscript and descendants" graphics APIs, ie
>> Postscript, PDF, SVG.
> Postscript, PDF and SVG, all use the same basic imaging model (PDF and SVG
> add Porter-Duff transparency).

Agreed. They use the same basic path compositing operations, but different
highr level operations like horizontal linetos or arcs.

> Would you be happy with me sending this to the list?

I am fine with this. I just sent the last mail because I pressed the wrong
button in my mail client. A copy of this last mail was sent to the list.


More information about the cairo mailing list