Sha256: f680f176ecf8c87abd39da65030582ddc60c8549b7ad9e7e0d2b6b8b72fe0cfc

Contents?: true

Size: 787 Bytes

Versions: 6

Compression:

Stored size: 787 Bytes

Contents

#!/usr/bin/env ruby -w

require 'rmagick'

imgl = Magick::ImageList.new
imgl.new_image(190, 190)

sample = Magick::Draw.new
sample.stroke('transparent')
if RUBY_PLATFORM =~ /mswin32/
  sample.font_family('Georgia')
else
  sample.font_family('times')
end
sample.font_weight(Magick::NormalWeight)
sample.pointsize(24)

sample.font_style(Magick::NormalStyle)
sample.text(20, 40, 'NormalStyle')

sample.font_style(Magick::ItalicStyle)
sample.text(20, 70, 'ItalicStyle')

sample.font_style(Magick::ObliqueStyle)
sample.text(20, 100, 'ObliqueStyle')

sample.font_style(Magick::NormalStyle)
sample.font_weight(Magick::BoldWeight)
sample.text(20, 130, 'BoldWeight')

sample.font_weight(Magick::LighterWeight)
sample.text(20, 160, 'LighterWeight')

sample.draw(imgl)

imgl.write('text.gif')
exit

Version data entries

6 entries across 6 versions & 1 rubygems

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