漢字の出力方法
#!/usr/bin/ruby -Ke require "GD" require "iconv" im = GD::Image.new(800,400) white = im.colorAllocate(255,255,255) blue = im.colorAllocate(0,0,255) str=Iconv.iconv("utf8","euc-jp","abc ABC 漢字を表示してみよう")[0] im.stringTTF(blue,"/usr/share/fonts/truetype/kochi/kochi-mincho.ttf", 30,0,10,200,str) im.stringTTF(blue,"/usr/share/fonts/truetype/kochi/kochi-gothic.ttf", 30,0,10,250,str) im.stringTTF(blue,"/usr/share/fonts/truetype/X-TT/wadalab-gothic.ttf",30,0,10,300,str) im.png STDOUT
wadalabフォントはちゃんと出ない。
kochi-minchoはapt-get出来る。