Sha256: 23504f3c9e65226164531829096de6faed51985e27be26a714b5136b3d40bbe4

Contents?: true

Size: 765 Bytes

Versions: 37

Compression:

Stored size: 765 Bytes

Contents

#! /usr/local/bin/ruby -w
require 'RMagick'

imgl = Magick::ImageList.new
imgl.new_image(275, 170) { self.background_color = "white" }

gc = Magick::Draw.new
gc.fill('black')
gc.stroke('transparent')

if RUBY_PLATFORM =~ /mswin32/
	gc.font_family('Georgia')
	gc.pointsize(152)
else
	gc.font_family('courier')
	gc.pointsize(200)
end
gc.font_weight(Magick::BoldWeight)

# Turn off antialiasing
gc.text_antialias(false)
gc.text(15, 145, 'A')

# Turn it back on
gc.text_antialias(true)
gc.text(145, 145, 'A')

gc.draw(imgl)

# Blow up the image so we can
# easily see the image, then
# crop to a representative portion.
imgl.resize!(3).crop!(235,270, 365,180)
imgl.page = Magick::Rectangle.new(365, 180)
imgl.border!(1,1,"black")
imgl.write("text_antialias.gif")
exit

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
rmagick-2.13.4 doc/ex/text_antialias.rb
rmagick-2.13.3 doc/ex/text_antialias.rb
rmagick-2.13.3.rc1 doc/ex/text_antialias.rb
rmagick-2.13.2 doc/ex/text_antialias.rb
rdp-rmagick-0.0.0 doc/ex/text_antialias.rb
rmagick-2.13.1 doc/ex/text_antialias.rb
rmagick-2.12.2 doc/ex/text_antialias.rb
rmagick-2.12.1 doc/ex/text_antialias.rb
rmagick-2.12.0 doc/ex/text_antialias.rb
rmagick-2.11.1 doc/ex/text_antialias.rb
rmagick-2.10.0 doc/ex/text_antialias.rb
rmagick-2.11.0 doc/ex/text_antialias.rb
rmagick-1.15.10 doc/ex/text_antialias.rb
rmagick-1.15.12 doc/ex/text_antialias.rb
rmagick-1.15.11 doc/ex/text_antialias.rb
rmagick-1.15.13 doc/ex/text_antialias.rb
rmagick-1.15.14 doc/ex/text_antialias.rb
rmagick-1.15.15 doc/ex/text_antialias.rb
rmagick-1.15.16 doc/ex/text_antialias.rb
rmagick-1.15.17 doc/ex/text_antialias.rb