Example:
require "RMagick"
def show_textimg
bg = Magick::Image.new(120,20){self.background_color = "#9E9E9E"}
text = Magick::Draw.new
text.encoding = "Unicode"
text.text(23,14,"ドの半角⇔全角")
text.draw(bg)
bg.write "#{RAILS_ROOT}/public/images/text.jpg"
end
http://thinkingrails.blogspot.com/2009/08/creating-images-from-unicode-text-using.html
No comments:
Post a Comment