Sha256: 68b21a5c7d4b6f2b49121facf27443ce480ee5012717ef5806c9867f679be9bf

Contents?: true

Size: 616 Bytes

Versions: 6

Compression:

Stored size: 616 Bytes

Contents

require 'rvg/rvg'

Magick::RVG.dpi = 90

rvg = Magick::RVG.new(10.cm, 3.cm).viewbox(0, 0, 1000, 300) do |canvas|
  canvas.background_fill = 'white'
  canvas.desc = "Example tspan02 - using tspan's dx and dy attributes for incremental positioning adjustments"
  canvas.g.styles(font_family: 'Verdana', font_size: 45) do |g|
    g.text(200, 150, 'But you').styles(fill: 'blue') do |txt|
      txt.tspan('are').d(100, -50).styles(font_weight: 'bold', fill: 'red')
      txt.tspan(' a peach!').d(0, 100)
    end
  end
  canvas.rect(996, 296, 1, 1).styles(fill: 'none', stroke: 'blue')
end

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

Version data entries

6 entries across 6 versions & 1 rubygems

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