Sha256: c5952b9c1780295b237dad95a42f63e37b8cff21e7ada1f4e199c27277895ecd

Contents?: true

Size: 624 Bytes

Versions: 59

Compression:

Stored size: 624 Bytes

Contents

require 'rvg/rvg'

rvg = Magick::RVG.new(150, 100) do |canvas|
    canvas.background_fill = 'white'
    canvas.text(40, 35).styles(:font_weight=>'bold', :font_size=>28) do |txt|
        txt.tspan('H')
        txt.tspan('2').styles(:font_size=>20, :fill=>'red', :baseline_shift=>'sub')
        txt.tspan('O')
    end
    canvas.text(40, 80).styles(:font_style=>'italic', :font_size=>28) do |txt|
        txt.tspan('e=mc')
        txt.tspan('2').styles(:font_size=>20, :fill=>'red', :baseline_shift=>'super')
    end
    canvas.rect(149, 99).styles(:fill=>'none', :stroke=>'blue')
end

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

Version data entries

59 entries across 59 versions & 2 rubygems

Version Path
rmagick-2.13.4 doc/ex/baseline_shift01.rb
rmagick-2.13.3 doc/ex/baseline_shift01.rb
rmagick-2.13.3.rc1 doc/ex/baseline_shift01.rb
rmagick-2.13.2 doc/ex/baseline_shift01.rb
rdp-rmagick-0.0.0 doc/ex/baseline_shift01.rb
rmagick-2.13.1 doc/ex/baseline_shift01.rb
rmagick-2.12.2 doc/ex/baseline_shift01.rb
rmagick-2.12.1 doc/ex/baseline_shift01.rb
rmagick-2.12.0 doc/ex/baseline_shift01.rb
rmagick-2.11.1 doc/ex/baseline_shift01.rb
rmagick-2.10.0 doc/ex/baseline_shift01.rb
rmagick-2.11.0 doc/ex/baseline_shift01.rb
rmagick-1.10.1 doc/ex/baseline_shift01.rb
rmagick-1.10.0 doc/ex/baseline_shift01.rb
rmagick-1.13.0 doc/ex/baseline_shift01.rb
rmagick-1.12.0 doc/ex/baseline_shift01.rb
rmagick-1.11.1 doc/ex/baseline_shift01.rb
rmagick-1.11.0 doc/ex/baseline_shift01.rb
rmagick-1.15.1 doc/ex/baseline_shift01.rb
rmagick-1.15.0 doc/ex/baseline_shift01.rb