[cairo] New ruby cairo binding landed in CVS

Ned Konz ned at squeakland.org
Tue Feb 8 12:25:29 PST 2005


On Tuesday 08 February 2005 8:14 am, Øyvind Kolås wrote:
> Announcing a re spawned rcairo
[snip]
> Feedback and patches are appreciated, especially regarding how cairo
> code should be used from ruby. Most of the fancy things can be added
> as syntactic sugar, but I am uncertain how to handle for instance
> enumerated values in a good way.
>

cr.new_path
      # I wonder if the namespacing for enumerated values like the
      # font attributes should be done differently
      cr.select_font "Sans", Cairo::FONT_WEIGHT_NORMAL, 
Cairo::FONT_SLANT_NORMAL
      cr.scale_font 140
      # most methods return self in the current binding thus allowing drawing
      # commands to be strung together
      cr.move_to(50, 230).text_path "rcairo"
    cr.close_path

Why not take a block for the path?

See the attached.

Also, it looks as if the 

 alias line_width= set_line_width

doesn't work inside methods of that class (you have to use set_line_width() 
instead). I didn't remember that.

-- 
Ned Konz
http://bike-nomad.com/squeak/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rcairo-ned.rb
Type: application/x-ruby
Size: 1531 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050208/25ab2a33/rcairo-ned.bin


More information about the cairo mailing list