1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require "rubygems"
require "RMagick"
require "rvg/rvg"

rvg = Magick::RVG.new(150, 100) do |canvas|
  canvas.background_fill = 'white'
  canvas.text(140, 20).styles(
    :font_size => 28,
    :text_anchor => "end"
  ) do |txt|
    txt.tspan("first")
    txt.tspan("second")
  end
end
rvg.draw.write("output.gif")