[cairo] Observations from a newb

Dirk Schönberger dirk.schoenberger at sz-online.de
Thu Nov 8 04:07:49 PST 2007

>> You must remember that cairo follows the simple is beautiful and no
>> duplication philosophy. It does not duplicate when other free
>> libraries can do the same and better.
> Sure, but sometimes it gets fuzzy. "Drawing" implies putting stuff down on
> a
> surface. It gets weird when you need to put stuff down that you have in
> mind
> but have to go fishing around and joining other libs to cairo.

Agreed. Graphics consists of vector paths, text output and image
rendering. cairo-core currently just provides the first.
However I am not quite sure if this cairo-framework should be done on a
binding level. It should be possible to draw an RGBA buffer onto a cairo
surface, possibly using a transformation and a quality setting (nearest
neighbor, bilinear, bicubic filtering etc). How this RGBA buffer is
created is left to the actual binding.

>> 1. ctx.draw_svg(<svg object>)
>> - librsvg is very good,has a liberal license and draws using cairo so
>> there is no need to duplicate.
> I can't get it to work. Would love to see what it does.
>> - My wishlist however is to have librsvg output to cairo commands or
>> capture the commands somehow, so i can compile in svg art without the
>> librsvg dependency.
> Yes - this is what I am muddling with right now. Well, not librsvg, but to
> open an svg file, parse it to some extent and then produce a string of
> <pycairo commands> that can be drawn later with exec.

Sounds like the concept of a "metafile", i.e. a collection of drawing
commands which can be later executed directly.

>> 3. cairo is not a font library
>> - pango is awesome just wish it was a little faster on latin text :-)
>> - I sympathize with people who are trying to use custom fonts with
>> cairo since it can be a pain and not always accessible from python.
> Yes, it's always amazed me that fonts on Gnu/Linux are so divorced from an
> actual font file!

Problem is that there exist more font formats than ttf files. A font
system tries to provide an abstraction over these different font formats
and matching algorithms.
Giving access to the font files directly is a rarely needed border usecase ;)


More information about the cairo mailing list