Added some methods.
authorKoichi KAMICHI <kamichi@fonts.jp>
Sun, 12 Feb 2006 02:45:04 +0000 (02:45 +0000)
committerKoichi KAMICHI <kamichi@fonts.jp>
Sun, 12 Feb 2006 02:45:04 +0000 (02:45 +0000)
engine/buhin.js [new file with mode: 0755]
engine/kage.js

diff --git a/engine/buhin.js b/engine/buhin.js
new file mode 100755 (executable)
index 0000000..455d274
--- /dev/null
@@ -0,0 +1,27 @@
+function Buhin(number){\r
+  // method\r
+  function push(name, data){ // void\r
+    var temp = new Object();\r
+    temp.name = name;\r
+    temp.data = data;\r
+    this.array.push(temp);\r
+  }\r
+  Buhin.prototype.push = push;\r
+  \r
+  function search(name){ // string\r
+    for(var i = 0; i < this.array.length; i++){\r
+      if(this.array[i].name == name){\r
+        return this.array[i].data;\r
+      }\r
+    }\r
+  }\r
+  Buhin.prototype.search = search;\r
+  \r
+  // property\r
+  this.array = new Array();\r
+  \r
+  // initialize\r
+  // no operation\r
+  \r
+  return this;\r
+}\r
index c729b2d..1386ecb 100755 (executable)
@@ -1,4 +1,27 @@
 function Kage(){\r
+  // method\r
+  function drawFont(polygons, glyph){ // void\r
+    // [glyph] : [stroke]$[stroke]$.....\r
+    // [stroke] : [column]:[column]:.....\r
+    var strokes = glyph.split("$");\r
+    for(var i = 0; i < strokes.length; i++){\r
+      var columns = strokes[i].split(":");\r
+      if(Math.floor(columns[0] ! 99){\r
+        dfDrawFont(this, polygons,\r
+                   Math.floor(columns[0]),\r
+                   Math.floor(columns[1]), Math.floor(columns[2]),\r
+                   Math.floor(columns[3]), Math.floor(columns[4]),\r
+                   Math.floor(columns[5]), Math.floor(columns[6]),\r
+                   Math.floor(columns[7]), Math.floor(columns[8]),\r
+                   Math.floor(columns[9]), Math.floor(columns[10]));\r
+      } else {\r
+        //buhin\r
+      }\r
+    }\r
+  }\r
+  Kage.prototype.drawFont = drawFont;\r
+  \r
+  //properties\r
   Kage.prototype.kMincho = 0;\r
   Kage.prototype.kGothic = 1;\r
   this.kShotai = this.kMincho;\r
@@ -10,6 +33,7 @@ function Kage(){
   this.kKakato = 3;\r
   //has KAKATO = 2, no KAKATO = 1\r
   this.kL2RDfatten = 1.1;\r
+  this.kBuhin = new Buhin();\r
   \r
   return this;\r
 }\r