def draw_text(cr)
cr.translate(RADIUS, RADIUS);
layout = cr.create_pango_layout
layout.set_text("Text")
desc = Pango::FontDescription.new(FONT)
layout.set_font_description(desc)
N_WORDS.times do |i|
angle = (360.0 * i) / N_WORDS;
cr.save do
red = (1 + Math.cos((angle - 60) * Math::PI / 180.0)) / 2
cr.set_source_rgb(red, 0, 1.0 - red)
cr.rotate(angle * Math::PI / 180.0)
cr.update_pango_layout(layout)
width, height = layout.size
cr.move_to(-(width.to_f / Pango::SCALE) / 2, -RADIUS)
cr.show_pango_layout(layout)
end
end
end