require "sgl"
#require "kconv"
-require "uconv"
+#require "uconv"
+require "chise/iconv"
require "chise/config"
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
@rend = StrokesRenderer.new
@rend.hsv = [50, 100, 100]
end
+
def read_file()
open(@file) {|f|
while(line = f.gets)
end
}
end
+
def init(code)
glyph = @glyphs[code]
return if glyph == nil
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