Sha256: cbe0b106e30c06f4e0139c6bdfc1685c7879270ba1a08f7697b7b79f430a4fea

Contents?: true

Size: 591 Bytes

Versions: 13

Compression:

Stored size: 591 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

13 entries across 13 versions & 3 rubygems

Version Path
rmagick-windows-2.16.5 doc/ex/baseline_shift01.rb
rmagick-windows-2.16.4 doc/ex/baseline_shift01.rb
rmagick-windows-2.16.3 doc/ex/baseline_shift01.rb
rmagick-windows-2.16.2 doc/ex/baseline_shift01.rb
rmagick-windows-2.16.1 doc/ex/baseline_shift01.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/rmagick-2.16.0/doc/ex/baseline_shift01.rb
rmagick-2.16.0 doc/ex/baseline_shift01.rb
rmagick-2.15.4 doc/ex/baseline_shift01.rb
rmagick-2.15.3 doc/ex/baseline_shift01.rb
rmagick-2.15.2 doc/ex/baseline_shift01.rb
rmagick-2.15.1 doc/ex/baseline_shift01.rb
rmagick-2.15.0 doc/ex/baseline_shift01.rb
rmagick-2.14.0 doc/ex/baseline_shift01.rb