i
[chise/ruby.git] / chise / csf.rb
index e29c219..fd8bf1f 100755 (executable)
@@ -2,7 +2,8 @@
 
 require "sgl"
 #require "kconv"
-require "uconv"
+#require "uconv"
+require "chise/iconv"
 require "chise/config"
 
 module StrokeFont
@@ -64,10 +65,12 @@ module StrokeFont
       @strokes = nil
     end
     attr_reader :strokes
+
     def parse()
       return if @strokes
       @strokes = CSFParser.parse(@stroke_str)
     end
+
     def init
       parse if @strokes.nil?
     end
@@ -82,6 +85,7 @@ module StrokeFont
       @rend = StrokesRenderer.new
       @rend.hsv = [50, 100, 100]
     end
+
     def read_file()
       open(@file) {|f|
        while(line = f.gets)
@@ -92,6 +96,7 @@ module StrokeFont
        end
       }
     end
+
     def init(code)
       glyph = @glyphs[code]
       return if glyph == nil
@@ -99,21 +104,24 @@ module StrokeFont
       glyph.parse
       @rend.set_strokes(glyph.strokes)
     end
+
     def draw(code) #\88ø\90\94\82É\82ÍJIS\82ð\90\94\92l\89»\82µ\82½\82à\82Ì\82ª\82Í\82¢\82é
       glyph = @glyphs[code]
       return if glyph == nil
       @rend.draw
     end
+
     def print(code)
       jis = JISX0208.new
       char = jis.get_char(code)
       printf("[%s][%04x]\n", char.nil? ? "nil" : char.map_sjis, code)
     end
+
     def ucs_to_jis(ucs)
       char = Character.get(ucs)
       j = char.japanese_jisx0208
       return j
     end
-  end
 
+  end
 end