Ming/Ruby

Ming/Ruby is a Ruby extensional library for Ming which is independent of SWIG. Ming/Ruby also supports another version of Ming, called JaMing which is an improvement of Ming to display Japanese characters and to play sounds. To use Japanese fonts with JaMing, the letters must be followed the UTF-8 formats. Uconv, which is an UTF-8 extension library for Ruby, can be used to convert other Kanji encodings into Unicode.

NEWS
Our project are going to move to RubyForge. New URL is here: http://mingruby.rubyforge.org/
NEWS
Atoh hacks ming-ruby for the latest Ming (version 0.3 beta1)! See his ming-ruby-patch.

Now Ming/Ruby version 0.1.6 is available. Please download and try it. :) See also project history to check changes. Ming/Ruby works with Ruby version 1.6.7 and both Ming 0.2a and JaMing version 0.1.5. Unfortunately, the current CVS version Ming is not supported by Ruby/Ming because some interfaces are changed from Ming ver 0.2a. We need new codes to support future CVS versions.

Here is an example of Ming/Ruby with JaMing and Uconv to display Japanese characters. Have a fun to create your Flash movie with Ruby.

require 'ming/ming'
require 'uconv'
include Ming

$KCODE = 'e'

s = Uconv.euctou8('日本語')
m = SWFMovie.new
t = SWFText.new
f = SWFFont.new('some_japanese.fdb') # we have to prepare the Japanese font
t.set_font(f)
t.set_color(0x00, 0x70, 0xc0)
t.set_height(48)
t.add_string(s)
i = m.add(t)
i.move_to(100, 150)
m.save('japanese.swf')

See also another examples.

A hint for installing Ming 0.2a

Note: Ming of stable version 0.2a cannot be installed with recent GNU Bison (version > 1.35) because of a bug in the 'swf4compiler.y'. I recommend to compile Ming with GNU Bison 1.35.

Links


Back...
Daisuke Ikegami <ikegami@madscientist.jp>
Last modified: "2003-11-17"