Skip to content

Instantly share code, notes, and snippets.

@phelrine
Created December 22, 2011 15:50
Show Gist options
  • Save phelrine/1510760 to your computer and use it in GitHub Desktop.
Save phelrine/1510760 to your computer and use it in GitHub Desktop.
string animation
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'RMagick'
FONTPATH = "/usr/share/fonts/takao-fonts/TakaoPMincho.ttf"
draw = Magick::Draw.new{
self.font = FONTPATH
self.fill = "black"
self.gravity = Magick::CenterGravity
self.pointsize = 64
}
gif = Magick::ImageList.new
ARGV[0].split("").each{|c|
img = Magick::Image.new(72, 72){
self.background_color = "white"
}
draw.annotate(img, 0, 0, 0, 0, c)
gif << img
}
gif.iterations = 0
gif.delay = 60
gif.write ARGV[1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment