Sha256: 993739780610fef0d65054df4bc3ec6768fffa7098006d1a310e2adc47d97504

Contents?: true

Size: 646 Bytes

Versions: 4

Compression:

Stored size: 646 Bytes

Contents

require 'rvg/rvg'
include Magick

RVG.dpi = 90
Fill = %w{yellow pink green blue cyan red purple brown}

rvg = RVG.new(6.cm, 6.cm).viewbox(0,0,600,600) do |canvas|
    canvas.background_fill = 'white'

    ref_text = RVG::Tspan.new("Referenced").styles(:font_size=>52, :font_weight=>'bold')

    canvas.g.translate(300,270) do |grp|
        angle = 0
        8.times do |n|
            grp.text do |txt|
                txt.tref(ref_text).d(0,30).rotate(angle).styles(:fill=>Fill[n])
                angle += 45
            end
        end
    end

    canvas.rect(596,596).styles(:fill=>'none',:stroke=>'blue')

end

rvg.draw.write('tref01.gif')

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rmagick-1.8.0 doc/ex/tref01.rb
rmagick-1.8.1 doc/ex/tref01.rb
rmagick-1.8.2 doc/ex/tref01.rb
rmagick-1.8.3 doc/ex/tref01.rb