# Real time vector graphics

**URL:** <https://www.ruby-forum.com/t/real-time-vector-graphics/83156>\
**Category:** Ruby\
**Created:** [January 23, 2007, 10:42pm UTC](https://www.ruby-forum.com/t/real-time-vector-graphics/83156 "2007-01-23T22:42:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SonOfLilit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@SonOfLilit](https://www.ruby-forum.com/u/SonOfLilit)\
**Post date:** [January 23, 2007, 10:42pm UTC](https://www.ruby-forum.com/t/real-time-vector-graphics/83156/1 "2007-01-23T22:42:34Z")

</div>

Hello all,

I’m planning to prototype a vector graphics Zooming User Interface using  
ruby (because it feels good and it’s just a prototype - in the case that  
I  
elect to build the system I will probably force myself to learn a lisp  
and  
OpenGL or OpenVG).

Has anyone tried to use the ruby bindings of Cairo? Is there an  
alternative?

Any tips?

By the way, does anyone know of an online resource discussing low-level  
implementation of graphical user interfaces?

I run OSX on a Mac Mini.

Thanks,

Aur S.

---

<div class="post-metadata">

**Author:** ![SonOfLilit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@SonOfLilit](https://www.ruby-forum.com/u/SonOfLilit)\
**Post date:** [January 28, 2007, 8:24am UTC](https://www.ruby-forum.com/t/real-time-vector-graphics/83156/2 "2007-01-28T08:24:30Z")

</div>

Thank you, and I’ve read that.

I’ve read that Cairo is slow. Is that true or random whining?

LISP is for the combination of language dynamicism and speed.

---

<div class="post-metadata">

**Author:** ![SonOfLilit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@SonOfLilit](https://www.ruby-forum.com/u/SonOfLilit)\
**Post date:** [January 27, 2007, 10:07pm UTC](https://www.ruby-forum.com/t/real-time-vector-graphics/83156/3 "2007-01-27T22:07:31Z")

</div>

On 1/23/07, SonOfLilit [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> …  
> I’m planning to prototype a vector graphics Zooming User Interface using  
> ruby (because it feels good and it’s just a prototype - in the case that I  
> elect to build the system I will probably force myself to learn a lisp and  
> OpenGL or OpenVG).

Some Lisp dialect + OpenVG would be an…interesting choice for the  
actual implementation. Does your choice of a Lisp dialect have  
anything to due with the fact that some early ZUIs were written in a  
Lisp dialect?

Also, a fast OpenVG implementation isn’t (yet) readily available for  
most common hardware/OS combinations out there, so you may run into  
portability/speed problems with OpenVG.

> Has anyone tried to use the ruby bindings of Cairo? Is there an alternative?

Yes, they work great once you get them installed. Go here to find the  
(very helpful) community behind them:

> **[The source of https://ruby-gnome.github.io/](https://ruby-gnome.github.io/)**
>
> The source of https://ruby-gnome.github.io/

Cairo would be a good choice if you need 1) high portability 2)  
hardware acceleration when available 3) open-source with few licensing  
restrictions (LGPL).

Cairo has an OpenGL backend, and there’s been talk about writing an  
OpenVG backend too. So using Cairo would mean that your code wouldn’t  
have to change very much as you try out different rendering targets.

> By the way, does anyone know of an online resource discussing low-level  
> implementation of graphical user interfaces?

You may be interesting in the paper “Implementing a Zooming User  
Interface: Experience Building Pad++” by Benderson et. al

Dan

---

<div class="post-metadata">

**Author:** ![SonOfLilit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@SonOfLilit](https://www.ruby-forum.com/u/SonOfLilit)\
**Post date:** [January 28, 2007, 6:49pm UTC](https://www.ruby-forum.com/t/real-time-vector-graphics/83156/4 "2007-01-28T18:49:20Z")

</div>

On 1/27/07, SonOfLilit [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thank you, and I’ve read that.
> 
> I’ve read that Cairo is slow. Is that true or random whining?

Depends on what you’re doing with it, which backend you’re using and  
what you’re comparing it to when you say “slow”. You should probably  
do some quick prototyping to get an idea of how it performs for your  
projected use. That said, it’s fast enough for GTK, OpenOffice, and  
Firefox (among others) to use. And if you find a particularly slow  
case, send it to the mailing list. Performance bugs get squashed  
pretty fast.

Oh, and use the latest stable snapshot (1.3.12) as it much faster than  
the 1.2.x series.

Dan

---

<div class="post-metadata">

**Author:** ![SonOfLilit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@SonOfLilit](https://www.ruby-forum.com/u/SonOfLilit)\
**Post date:** [January 28, 2007, 7:17pm UTC](https://www.ruby-forum.com/t/real-time-vector-graphics/83156/5 "2007-01-28T19:17:21Z")

</div>

On 1/28/07, SonOfLilit [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> How do I get started with Ruby/GTK to develop Cairo vector graphics on OSX?
> 
> Or is there a simpler way than Ruby/GTK?
> 
> Perhaps SDL?

On OSX, you can use Cairo with pretty much anything (SDL, OpenGL, GTK,  
regular Carbon/Cocoa applications). You just have to figure out how to  
get the different ruby bindings to work together, which can be fun.  
GTK is the easiest, IMO.

As to how to get started, if I remember right, there are some examples  
in the repository, but you really should ask over at the ruby-gnome2  
mailing list. Kouhei S. is the guy to look for:

> **[ruby-gnome2-devel-en List Signup and Options](https://sourceforge.net/projects/ruby-gnome2/lists/ruby-gnome2-devel-en)**
>
> This project is a set of Ruby language bindings for the various application development libraries included with the GNOME/GTK+ environment.
> This…

Dan

---

<div class="post-metadata">

**Author:** ![SonOfLilit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@SonOfLilit](https://www.ruby-forum.com/u/SonOfLilit)\
**Post date:** [January 28, 2007, 2:51pm UTC](https://www.ruby-forum.com/t/real-time-vector-graphics/83156/6 "2007-01-28T14:51:32Z")

</div>

How do I get started with Ruby/GTK to develop Cairo vector graphics on  
OSX?

Or is there a simpler way than Ruby/GTK?

Perhaps SDL?

Aur S.
