From a7a874d65a69e2f0bd5bcbe353bc74cb4f656caa Mon Sep 17 00:00:00 2001 From: Koichi KAMICHI Date: Tue, 21 Feb 2006 06:47:54 +0000 Subject: [PATCH] Reformatted. --- engine/kage.js | 110 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/engine/kage.js b/engine/kage.js index 0a91bb7..d91d102 100755 --- a/engine/kage.js +++ b/engine/kage.js @@ -1,61 +1,61 @@ 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 { - var buhin = this.kBuhin.search(columns[7]); - if(buhin != ""){ - this.drawBuhin(polygons, buhin, - Math.floor(columns[3]), - Math.floor(columns[4]), - Math.floor(columns[5]), - Math.floor(columns[6])); - } - } - } + // 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 { + var buhin = this.kBuhin.search(columns[7]); + if(buhin != ""){ + this.drawBuhin(polygons, buhin, + Math.floor(columns[3]), + Math.floor(columns[4]), + Math.floor(columns[5]), + Math.floor(columns[6])); } - Kage.prototype.drawFont = drawFont; - + } + } + } + Kage.prototype.drawFont = drawFont; + function drawBuhin(polygons, glyph, x1, y1, x2, y2){ - 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]), - x1 + Math.floor(columns[3]) * (x2 - x1) / 200, - y1 + Math.floor(columns[4]) * (y2 - y1) / 200, - x1 + Math.floor(columns[5]) * (x2 - x1) / 200, - y1 + Math.floor(columns[6]) * (y2 - y1) / 200, - x1 + Math.floor(columns[7]) * (x2 - x1) / 200, - y1 + Math.floor(columns[8]) * (y2 - y1) / 200, - x1 + Math.floor(columns[9]) * (x2 - x1) / 200, - y1 + Math.floor(columns[10]) * (y2 - y1) / 200); - } else { - var buhin = this.kBuhin.search(columns[7]); - if(buhin != ""){ - this.drawBuhin(polygons, buhin, - x1 + Math.floor(columns[3]) * (x2 - x1) / 200, - y1 + Math.floor(columns[4]) * (y2 - y1) / 200, - x1 + Math.floor(columns[5]) * (x2 - x1) / 200, - y1 + Math.floor(columns[6]) * (y2 - y1) / 200); - } - } - } + 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]), + x1 + Math.floor(columns[3]) * (x2 - x1) / 200, + y1 + Math.floor(columns[4]) * (y2 - y1) / 200, + x1 + Math.floor(columns[5]) * (x2 - x1) / 200, + y1 + Math.floor(columns[6]) * (y2 - y1) / 200, + x1 + Math.floor(columns[7]) * (x2 - x1) / 200, + y1 + Math.floor(columns[8]) * (y2 - y1) / 200, + x1 + Math.floor(columns[9]) * (x2 - x1) / 200, + y1 + Math.floor(columns[10]) * (y2 - y1) / 200); + } else { + var buhin = this.kBuhin.search(columns[7]); + if(buhin != ""){ + this.drawBuhin(polygons, buhin, + x1 + Math.floor(columns[3]) * (x2 - x1) / 200, + y1 + Math.floor(columns[4]) * (y2 - y1) / 200, + x1 + Math.floor(columns[5]) * (x2 - x1) / 200, + y1 + Math.floor(columns[6]) * (y2 - y1) / 200); + } + } + } } Kage.prototype.drawBuhin = drawBuhin; -- 1.7.10.4