Sha256: e1055f8751b7324f2f997ad6020cfc5ff80e76068cca7648a9d7f7708d8d6044

Contents?: true

Size: 592 Bytes

Versions: 4

Compression:

Stored size: 592 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 tspan01 - using tspan to change visual attributes"
    canvas.g.styles(:font_family=>'Verdana', :font_size=>45) do |grp|
        grp.text(200, 150, "You are ").styles(:fill=>'blue') do |txt|
            txt.tspan("not").styles(:font_weight=>'bold', :fill=>'red')
            txt.tspan(" a banana")
        end
    end
    canvas.rect(997, 297).styles(:fill=>'none', :stroke=>'blue')
end

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

Version data entries

4 entries across 4 versions & 1 rubygems

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