From: Koichi KAMICHI Date: Sun, 12 Feb 2006 02:45:04 +0000 (+0000) Subject: Added some methods. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa4da0d9febf3ed81adda64b6da8fc277af83921;p=chise%2Fkage.git Added some methods. --- diff --git a/engine/buhin.js b/engine/buhin.js new file mode 100755 index 0000000..455d274 --- /dev/null +++ b/engine/buhin.js @@ -0,0 +1,27 @@ +function Buhin(number){ + // method + function push(name, data){ // void + var temp = new Object(); + temp.name = name; + temp.data = data; + this.array.push(temp); + } + Buhin.prototype.push = push; + + function search(name){ // string + for(var i = 0; i < this.array.length; i++){ + if(this.array[i].name == name){ + return this.array[i].data; + } + } + } + Buhin.prototype.search = search; + + // property + this.array = new Array(); + + // initialize + // no operation + + return this; +} diff --git a/engine/kage.js b/engine/kage.js index c729b2d..1386ecb 100755 --- a/engine/kage.js +++ b/engine/kage.js @@ -1,4 +1,27 @@ function Kage(){ + // method + function drawFont(polygons, glyph){ // void + // [glyph] : [stroke]$[stroke]$..... + // [stroke] : [column]:[column]:..... + var strokes = glyph.split("$"); + for(var i = 0; i < strokes.length; i++){ + var columns = strokes[i].split(":"); + if(Math.floor(columns[0] ! 99){ + dfDrawFont(this, polygons, + Math.floor(columns[0]), + Math.floor(columns[1]), Math.floor(columns[2]), + Math.floor(columns[3]), Math.floor(columns[4]), + Math.floor(columns[5]), Math.floor(columns[6]), + Math.floor(columns[7]), Math.floor(columns[8]), + Math.floor(columns[9]), Math.floor(columns[10])); + } else { + //buhin + } + } + } + Kage.prototype.drawFont = drawFont; + + //properties Kage.prototype.kMincho = 0; Kage.prototype.kGothic = 1; this.kShotai = this.kMincho; @@ -10,6 +33,7 @@ function Kage(){ this.kKakato = 3; //has KAKATO = 2, no KAKATO = 1 this.kL2RDfatten = 1.1; + this.kBuhin = new Buhin(); return this; }