SVG Text can now be rendered in the Gtk2SVG gem

#!/usr/bin/env ruby

# file: draw3.rb


require 'gtk2svg'

s =<<SVG
<svg width="400" height="110">
   <text x="50" y="50" fill="red">I love SVG!</text>
</svg>
SVG

a = Gtk2SVG::Render.new(s).to_a

area = Gtk::DrawingArea.new

area.signal_connect("expose_event") do

  drawing = Gtk2SVG::DrawingInstructions.new area
  drawing.render a

end

Gtk::Window.new.add(area).show_all
Gtk.main

Screenshot

Screenshot of text rendered from the Gtk2SVG appliction

Resources