Skip navigation.

GTK+ to use Cairo Vector Engine

GTK
GTK

GTK+ is now the first major toolkit to have added support for the Cairo 2D vector graphics library, which is designed to provide high-quality display and print output.

GTK+ project leader Owen Taylor has commented on the X/GTK integration of Cairo. To put it in perspective, Cairo is similar to OSX's Quartz engine and Longhorn's Avalon (PPT analysis). The 3D hardware accelerated image compositing OpenGL part of Cairo will be provided by the Glitz library. Cairo is 'possible' to be part of Qt 4.x at a later date, according to Trolltech's Qt 4 technical preview document.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

There already is a svg->cairo

There already is a svg->cairo renderer called libxsvg written by carl worth. It is kinda neglected at the moment though, so the librsvg team are creating a cairo backend for our renderer which aught to be ready by the time it is needed by gnome. Making a SVG widget from that wouldn't be hard.

Also, the librsvg team is planning to add DOM support to it in the near future, so that would allow the widget to be interactive.

First? Evas, anyone?

It's had a Cairo drawing target for some time now. Honest :)

evas? what? by Anonymous George

Maybe a svg display widget?

This is great news. Maybe someone more talented than I can use cairo/svg and put together a simple gtk svg display widget - I can see lots of applications for it.

gtk-cairo

There is already a svg module in the Cairo CVS repository. Try libsvg-cairo. Using this, you can draw an SVG image to any Cairo surface. The gtkcairo module also implements a Cairo surface display for GTK.

Of course, if you want an SVG canvas, this is not for you. I am currently hacking on a gtkmm-based Cairo canvas though, which may, eventually, be that.

-Samuel

Inkscape

Aren't the Inkscape guys going to separate out a generic SVG canvas from their code at some point? That seems to make more sense than starting from scratch.

Inkscape is not based on Cair

Inkscape is not based on Cairo but on the Gnome canvas and libart instead.
Nonetheless, reusing code from Inkscape is something that will most certainly happen.

-Samuel

but is neither using libart

Inkcape switched the renderer from libart to their own one, livarot, some time a go.
however, the plan is to use Cairo as a rendered when they will consider it good enough.

3D slowdown

I long ago stopped bothering to recompile my graphics driver every kernel update (I don't game too much). Will my whole dekstop be dog slow now because I'm not using accelerated 3D?

the answer is no

but if you have an 3d accelerated video card, you can have all that super eye candy.

"Support"

Isn't support a bit exaggerated? "There's no real use of Cairo other then tests/testcairo.c"

Don't be so picky.

Every journey starts with a single step :-)

They had to start somewhere, and I bet that more will follow soon since this has been planned for quite some time now.

Source for the quote?

It's not on the Cairo website. In fact they have several examples of Cairo being used, or being integrated in to projects like OpenOffice and Mozilla. Cairo is new, but it does run, and there are already working applications that use it. Just because it isn't in production use by any major applications or libraries yet means nothing - support is being worked on (as this article shows), and in 6 months to a year you can probably expect to see a lot of things running on Cairo.

It's on the mailing list linked

Re: "Support"

Also "part of Qt" sounds strange. Qt 4.x may add an option to use Cairo but it will not become a part of it.

Whoa

There's intresting things going on! Does this mean we will be able to use vector-graphics themes?

Not just vector themes but ho

Not just vector themes but how about all widgets vector based? I'd love to be able to lay every thing out in inches or cenimeters and have it come out the same size on 640x480 or on 1600x1200 displays.

That would be great

IBM and some other display venders have display with resolution something like 3000x2000 on 19" screens. They are practically useless for other things than viewing X-ray imaes ans such, as normal widget systems renders too small to be readable.

With scalable widgets, such display could make wonders for desktop publishing and graphics artists. You would get a much better what you see is what you get experience than what current systems can offer. It would also make Apple font hinting patents irrellevant as there would be a sufficient number of pixels to display font forms correctly even at small view sizes.

From what I understand, technology like this will be included in Microsofts soon? to be released Longhorn OS. Wouldn't it be fun if Gnome had it first.

Yes, that's the plan

http://people.redhat.com/otaylor/guadec5/
http://www.gtk.org/plan/2.8/

SVG themes already exist

I've been using SVG icon themes for quite a while on my GNOME desktop, 0r haven't I?

RE: SVG themes already exist

Well, yes, SVG themes exist. But look at your post and compare "SVG icon themes" to "vector themes". Got the drift? ;-)

gtk-svg icons

There were some gtk vectorial (svg) icons concepts by Jimmac quite some time ago:
http://jimmac.musichall.cz/screenshots/gtk-needs-svg-icons.png

Questions about Screenshot

Within Nautilus' context menu, I see two things that I normally do not see; and I am wondering why I have never seen them, and how I could get them to appear if I wanted.

First, how come is there the "New Window" item?

Second, what about the "Disks" context item?

quite some time ago

As I said, this dates from "quite some time ago". The image actually dates from July 2002, so 2.5 years. Probably these entries have been suppressed since then.

Ok, let me get it staight

You mean we would get vector-based (whichever format) background images, application widgets, window manager themes, cursor themes, ...?
Tha's nice.
Wouldn't take quite a lot of processing power?

Would not, if properly implemented

What do You think about vector fonts, such as MS TrueType, OpenType, Freetype ot Adobe PostScript type 1. They were added on rather slow x86 hardware in MS OS/2 2.x and Win 3.1

Just cache! You nned to type text with Roman font at 16 px ? render those vectors into a matrix once per letter, and then re-use the matrix (bitmap).

Since RAM and HDD are getting larger each day - they can cache themes too.
And You canturn themes off, if Your system wold not like them.

PS: i wish interactive themes, like `xdesktopwaves` catching water drops from mouse pointer :)

rendering is slow

Yes. Just SVG icon themes are already much slower, too. Still, the possibility itself is exciting. I don't know much about this, but I guess that if a smart caching system is used, it should be possible to reduce re-rendering the vector images to an absolute minimum -- and do some pre-rendering. It would take more than just plugging the library in if you don't want performance to suffer bigtime in applications such as a GUI library (like Gtk or Qt).

4DWM

SGI's 4DWM/IMD has had SVG icons for quite some versions already. At least IRIX 6.5's version had SVG icons. Maybe its interestings to see how they solved these aspects and the related effects on performance. Or , perhaps there are other desktops which also feature this.

Wouldn't take quite a lot of

Wouldn't take quite a lot of processing power?

Perhaps not if 3d acceleration drives some processing into the GPU.