Sha256: b77140e9a7d04d0567eb503dd07944678a2b2e70ad137b58c9e6fe60b21a0d70

Contents?: true

Size: 654 Bytes

Versions: 4

Compression:

Stored size: 654 Bytes

Contents

require 'rvg/rvg'
include Magick

RVG::dpi = 90


rvg = 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

4 entries across 4 versions & 1 rubygems

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