Sha256: 804f9d34b53bb9d6f2b13dd13dd273474b4cd0adfd0c035fe08ddaec487eb2c3

Contents?: true

Size: 606 Bytes

Versions: 6

Compression:

Stored size: 606 Bytes

Contents

require 'rvg/rvg'

Magick::RVG.dpi = 90
Fill = %w[yellow pink green blue cyan red purple brown]

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

  ref_text = Magick::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

6 entries across 6 versions & 1 rubygems

Version Path
rmagick-4.1.0.rc2 doc/ex/tref01.rb
rmagick-4.1.0.rc1 doc/ex/tref01.rb
rmagick-4.0.0 doc/ex/tref01.rb
rmagick-3.2.0 doc/ex/tref01.rb
rmagick-3.1.0 doc/ex/tref01.rb
rmagick-3.0.0 doc/ex/tref01.rb