Addes Tate Width Adjust function
authorKoichi KAMICHI <kamichi@fonts.jp>
Mon, 28 Dec 2009 00:21:00 +0000 (00:21 +0000)
committerKoichi KAMICHI <kamichi@fonts.jp>
Mon, 28 Dec 2009 00:21:00 +0000 (00:21 +0000)
engine/curve.js
engine/kage.js
engine/kagecd.js
engine/kagedf.js

index 01bf840..d7be0b6 100644 (file)
@@ -125,7 +125,7 @@ function find_offcurve(kage, curve, sx, sy, result){
 }\r
 \r
 // ------------------------------------------------------------------\r
-function get_candidate(kage, curve, a1, a2, x1, y1, sx1, sy1, x2, y2){\r
+function get_candidate(kage, curve, a1, a2, x1, y1, sx1, sy1, x2, y2, opt3){\r
   var x, y, ix, iy, ir, ia, ib, tt, t, deltad;\r
   var hosomi = 0.5;\r
   \r
@@ -166,6 +166,9 @@ function get_candidate(kage, curve, a1, a2, x1, y1, sx1, sy1, x2, y2){
     else if(a2 == 7){\r
       deltad = Math.pow(1.0 - t, hosomi);\r
     }\r
+    else if(opt3 > 0){\r
+      deltad = ((kage.kMinWidthT - opt3 / 2) / kage.kMinWidthT) + opt3 / 2 / kage.kMinWidthT * t;\r
+    }\r
     else{ deltad = 1; }\r
     \r
     if(deltad < 0.15){\r
index 782a406..0f7bb66 100755 (executable)
@@ -3,7 +3,7 @@ function Kage(size){
   function makeGlyph(polygons, buhin){ // void\r
     var glyphData = this.kBuhin.search(buhin);\r
     if(glyphData != ""){\r
-      this.drawStrokesArray(polygons, this.adjustKirikuchi(this.adjustUroko(this.adjustKakato(this.getEachStrokes(glyphData)))));\r
+      this.drawStrokesArray(polygons, this.adjustKirikuchi(this.adjustUroko(this.adjustKakato(this.adjustTate(this.getEachStrokes(glyphData))))));\r
     }\r
   }\r
   Kage.prototype.makeGlyph = makeGlyph;\r
@@ -63,7 +63,7 @@ function Kage(size){
   }\r
   Kage.prototype.getEachStrokesOfBuhin = getEachStrokesOfBuhin;\r
   \r
-       function adjustUroko(strokesArray){ // strokesArray\r
+  function adjustUroko(strokesArray){ // strokesArray\r
     for(var i = 0; i < strokesArray.length; i++){\r
       if(strokesArray[i][0] == 1 && strokesArray[i][2] == 0){ // no operation for TATE\r
         for(var k = 0; k < this.kAdjustUrokoLengthStep; k++){\r
@@ -91,8 +91,27 @@ function Kage(size){
     return strokesArray;\r
   }\r
   Kage.prototype.adjustUroko = adjustUroko;\r
-       \r
-       function adjustKirikuchi(strokesArray){ // strokesArray\r
+  \r
+  function adjustTate(strokesArray){ // strokesArray\r
+    for(var i = 0; i < strokesArray.length; i++){\r
+      if((strokesArray[i][0] == 1 || strokesArray[i][3] || strokesArray[i][7]) && strokesArray[i][3] == strokesArray[i][5]){\r
+        for(var j = 0; j < strokesArray.length; j++){\r
+          if(i != j && (strokesArray[j][0] == 1 || strokesArray[j][3] || strokesArray[j][7]) && strokesArray[j][3] == strokesArray[j][5] &&\r
+             !(strokesArray[i][4] + 1 > strokesArray[j][6] || strokesArray[i][6] - 1 < strokesArray[j][4]) &&\r
+             Math.abs(strokesArray[i][3] - strokesArray[j][3]) < this.kMinWidthT * 4){\r
+            strokesArray[i][1] += (4 - Math.floor(Math.abs(strokesArray[i][3] - strokesArray[j][3]) / this.kMinWidthT)) * 100;\r
+            if(strokesArray[i][1] > this.kAdjustTateStep * 100){\r
+              strokesArray[i][1] = strokesArray[i][1] % 100 + this.kAdjustTateStep * 100;\r
+            }\r
+          }\r
+        }\r
+      }\r
+    }\r
+    return strokesArray;\r
+  }\r
+  Kage.prototype.adjustTate = adjustTate;\r
+  \r
+  function adjustKirikuchi(strokesArray){ // strokesArray\r
     for(var i = 0; i < strokesArray.length; i++){\r
       if(strokesArray[i][0] == 2 && strokesArray[i][1] == 32 &&\r
          strokesArray[i][3] > strokesArray[i][5] &&\r
@@ -110,7 +129,7 @@ function Kage(size){
     return strokesArray;\r
   }\r
   Kage.prototype.adjustKirikuchi = adjustKirikuchi;\r
-       \r
+  \r
   function adjustKakato(strokesArray){ // strokesArray\r
     for(var i = 0; i < strokesArray.length; i++){\r
       if(strokesArray[i][0] == 1 &&\r
@@ -215,9 +234,9 @@ function Kage(size){
   Kage.prototype.kMincho = 0;\r
   Kage.prototype.kGothic = 1;\r
   this.kShotai = this.kMincho;\r
-       \r
+  \r
   this.kRate = 100;\r
-       \r
+  \r
   if(size == 1){\r
     this.kMinWidthY = 1.2;\r
     this.kMinWidthT = 3.6;\r
@@ -258,8 +277,10 @@ function Kage(size){
     this.kAdjustUrokoLength = ([22, 36, 50]); // length for checking\r
     this.kAdjustUrokoLengthStep = 3; // number of steps\r
     this.kAdjustUrokoLine = ([22, 26, 30]); // check for crossing. corresponds to length\r
+    \r
+    this.kAdjustTateStep = 4;\r
   }\r
-\r
+  \r
   this.kBuhin = new Buhin();\r
   \r
   return this;\r
index b417576..d37f823 100755 (executable)
@@ -1,4 +1,4 @@
-function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2){\r
+function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, ta1, ta2){\r
   var rad, t;\r
   var x, y, v;\r
   var ix, iy, ia, ib, ir;\r
@@ -8,8 +8,19 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
   var XX, XY, YX, YY;\r
   var poly, poly2;\r
   var hosomi;\r
+  var kMinWidthT, kMinWidthT2;\r
+  var a1, a2, opt1, opt2, opt3;\r
   \r
   if(kage.kShotai == kage.kMincho){ // mincho\r
+    a1 = ta1 % 100;\r
+    a2 = ta2 % 100;\r
+    opt1 = Math.floor((ta1 % 1000) / 100);\r
+    opt2 = Math.floor(ta2 / 100);\r
+    opt3 = Math.floor(ta1 / 1000);\r
+    \r
+    kMinWidthT = kage.kMinWidthT - opt1 / 2;\r
+    kMinWidthT2 = kage.kMinWidthT - opt3 / 2;\r
+    \r
     switch(a1 % 100){\r
     case 0:\r
     case 7:\r
@@ -57,7 +68,7 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
       delta = 0;\r
       break;\r
     case 8: // get shorten for tail's circle\r
-      delta = -1 * kage.kMinWidthT * 0.5;\r
+      delta = -1 * kMinWidthT * 0.5;\r
       break;\r
     default:\r
       break;\r
@@ -93,13 +104,13 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
         // generating fatten curve -- begin\r
         var kage2 = new Kage();\r
         kage2.kMinWidthY = kage.kMinWidthY;\r
-        kage2.kMinWidthT = kage.kMinWidthT;\r
+        kage2.kMinWidthT = kMinWidthT;\r
         kage2.kWidth = kage.kWidth;\r
         kage2.kKakato = kage.kKakato;\r
         kage2.kRate = 10;\r
         \r
         var curve = new Array(2); // L and R\r
-        get_candidate(kage2, curve, a1, a2, x1, y1, sx1, sy1, x2, y2);\r
+        get_candidate(kage2, curve, a1, a2, x1, y1, sx1, sy1, x2, y2, opt3);\r
         \r
         var dcl12_34 = new Array(2);\r
         var dcr12_34 = new Array(2);\r
@@ -144,16 +155,16 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
           // line SUICHOKU by vector\r
           if(ix != 0 && iy != 0){\r
             ir = Math.atan(iy / ix * -1);\r
-            ia = Math.sin(ir) * (kage.kMinWidthT);\r
-            ib = Math.cos(ir) * (kage.kMinWidthT);\r
+            ia = Math.sin(ir) * (kMinWidthT);\r
+            ib = Math.cos(ir) * (kMinWidthT);\r
           }\r
           else if(ix == 0){\r
-            ia = kage.kMinWidthT;\r
+            ia = kMinWidthT;\r
             ib = 0;\r
           }\r
           else{\r
             ia = 0;\r
-            ib = kage.kMinWidthT;\r
+            ib = kMinWidthT;\r
           }\r
           \r
           if(a1 == 7 && a2 == 0){ // L2RD: fatten\r
@@ -165,6 +176,9 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
           else if(a2 == 7){\r
             deltad = Math.pow(1.0 - t, hosomi);\r
           }\r
+          else if(opt3 > 0){\r
+            deltad = ((kage.kMinWidthT - opt3 / 2) / kage.kMinWidthT) + opt3 / 2 / kage.kMinWidthT * t;\r
+          }\r
           else{ deltad = 1; }\r
           \r
           if(deltad < 0.15){\r
@@ -225,16 +239,16 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
         // line SUICHOKU by vector\r
         if(ix != 0 && iy != 0){\r
           ir = Math.atan(iy / ix * -1);\r
-          ia = Math.sin(ir) * (kage.kMinWidthT);\r
-          ib = Math.cos(ir) * (kage.kMinWidthT);\r
+          ia = Math.sin(ir) * (kMinWidthT);\r
+          ib = Math.cos(ir) * (kMinWidthT);\r
         }\r
         else if(ix == 0){\r
-          ia = kage.kMinWidthT;\r
+          ia = kMinWidthT;\r
           ib = 0;\r
         }\r
         else{\r
           ia = 0;\r
-          ib = kage.kMinWidthT;\r
+          ib = kMinWidthT;\r
         }\r
         \r
         if(a1 == 7 && a2 == 0){ // L2RD: fatten\r
@@ -305,16 +319,16 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
     if(a1 == 12){\r
       if(x1 == x2){\r
         poly= new Polygon();\r
-        poly.push(x1 - kage.kMinWidthT, y1);\r
-        poly.push(x1 + kage.kMinWidthT, y1);\r
-        poly.push(x1 - kage.kMinWidthT, y1 - kage.kMinWidthT);\r
+        poly.push(x1 - kMinWidthT, y1);\r
+        poly.push(x1 + kMinWidthT, y1);\r
+        poly.push(x1 - kMinWidthT, y1 - kMinWidthT);\r
         polygons.push(poly);\r
       }\r
       else{\r
         poly = new Polygon();\r
-        poly.push(x1 - kage.kMinWidthT * XX, y1 - kage.kMinWidthT * XY);\r
-        poly.push(x1 + kage.kMinWidthT * XX, y1 + kage.kMinWidthT * XY);\r
-        poly.push(x1 - kage.kMinWidthT * XX - kage.kMinWidthT * YX, y1 - kage.kMinWidthT * XY - kage.kMinWidthT * YY);\r
+        poly.push(x1 - kMinWidthT * XX, y1 - kMinWidthT * XY);\r
+        poly.push(x1 + kMinWidthT * XX, y1 + kMinWidthT * XY);\r
+        poly.push(x1 - kMinWidthT * XX - kMinWidthT * YX, y1 - kMinWidthT * XY - kMinWidthT * YY);\r
         polygons.push(poly);\r
       }\r
     }\r
@@ -336,32 +350,32 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
         }\r
         if(x1 == sx1){\r
           poly = new Polygon();\r
-          poly.push(x1 - kage.kMinWidthT, y1);\r
-          poly.push(x1 + kage.kMinWidthT, y1);\r
-          poly.push(x1 - kage.kMinWidthT * pm, y1 - kage.kMinWidthY * type * pm);\r
+          poly.push(x1 - kMinWidthT, y1);\r
+          poly.push(x1 + kMinWidthT, y1);\r
+          poly.push(x1 - kMinWidthT * pm, y1 - kage.kMinWidthY * type * pm);\r
           polygons.push(poly);\r
         }\r
         else{\r
           poly = new Polygon();\r
-          poly.push(x1 - kage.kMinWidthT * XX, y1 - kage.kMinWidthT * XY);\r
-          poly.push(x1 + kage.kMinWidthT * XX, y1 + kage.kMinWidthT * XY);\r
-          poly.push(x1 - kage.kMinWidthT * pm * XX - kage.kMinWidthY * type * pm * YX, y1 - kage.kMinWidthT * pm * XY - kage.kMinWidthY * type * pm * YY);\r
+          poly.push(x1 - kMinWidthT * XX, y1 - kMinWidthT * XY);\r
+          poly.push(x1 + kMinWidthT * XX, y1 + kMinWidthT * XY);\r
+          poly.push(x1 - kMinWidthT * pm * XX - kage.kMinWidthY * type * pm * YX, y1 - kMinWidthT * pm * XY - kage.kMinWidthY * type * pm * YY);\r
           polygons.push(poly);\r
         }\r
       }\r
       else{ //bottom to up\r
         if(x1 == sx1){\r
           poly = new Polygon();\r
-          poly.push(x1 - kage.kMinWidthT, y1);\r
-          poly.push(x1 + kage.kMinWidthT, y1);\r
-          poly.push(x1 + kage.kMinWidthT, y1 - kage.kMinWidthY);\r
+          poly.push(x1 - kMinWidthT, y1);\r
+          poly.push(x1 + kMinWidthT, y1);\r
+          poly.push(x1 + kMinWidthT, y1 - kage.kMinWidthY);\r
           polygons.push(poly);\r
         }\r
         else{\r
           poly = new Polygon();\r
-          poly.push(x1 - kage.kMinWidthT * XX, y1 - kage.kMinWidthT * XY);\r
-          poly.push(x1 + kage.kMinWidthT * XX, y1 + kage.kMinWidthT * XY);\r
-          poly.push(x1 + kage.kMinWidthT * XX - kage.kMinWidthY * YX, y1 + kage.kMinWidthT * XY - kage.kMinWidthY * YY);\r
+          poly.push(x1 - kMinWidthT * XX, y1 - kMinWidthT * XY);\r
+          poly.push(x1 + kMinWidthT * XX, y1 + kMinWidthT * XY);\r
+          poly.push(x1 + kMinWidthT * XX - kage.kMinWidthY * YX, y1 + kMinWidthT * XY - kage.kMinWidthY * YY);\r
           polygons.push(poly);\r
         }\r
       }\r
@@ -369,11 +383,11 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
     \r
     if(a1 == 22){ //box's up-right corner, any time same degree\r
       poly = new Polygon();\r
-      poly.push(x1 - kage.kMinWidthT, y1 - kage.kMinWidthY);\r
+      poly.push(x1 - kMinWidthT, y1 - kage.kMinWidthY);\r
       poly.push(x1, y1 - kage.kMinWidthY - kage.kWidth);\r
-      poly.push(x1 + kage.kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY);\r
-      poly.push(x1 + kage.kMinWidthT, y1 + kage.kMinWidthT);\r
-      poly.push(x1, y1 + kage.kMinWidthT);\r
+      poly.push(x1 + kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY);\r
+      poly.push(x1 + kMinWidthT, y1 + kMinWidthT);\r
+      poly.push(x1, y1 + kMinWidthT);\r
       polygons.push(poly);\r
     }\r
     \r
@@ -385,35 +399,35 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
         var move = kage.kMinWidthY * type * pm;\r
         if(x1 == sx1){\r
           poly = new Polygon();\r
-          poly.push(x1 + kage.kMinWidthT, y1 - move);\r
-          poly.push(x1 + kage.kMinWidthT * 1.5, y1 + kage.kMinWidthY - move);\r
-          poly.push(x1 + kage.kMinWidthT * 0.5, y1 + kage.kMinWidthY * 3 - move / 2);\r
+          poly.push(x1 + kMinWidthT, y1 - move);\r
+          poly.push(x1 + kMinWidthT * 1.5, y1 + kage.kMinWidthY - move);\r
+          poly.push(x1 + kMinWidthT * 0.5, y1 + kage.kMinWidthY * 3 - move / 2);\r
           polygons.push(poly);\r
         }\r
         else{\r
           poly = new Polygon();\r
-          poly.push(x1 + kage.kMinWidthT * XX - move * YX,\r
-                    y1 + kage.kMinWidthT * XY - move * YY);\r
-          poly.push(x1 + kage.kMinWidthT * 1.5 * XX + (kage.kMinWidthY - move * 1.2) * YX,\r
-                    y1 + kage.kMinWidthT * 1.5 * XY + (kage.kMinWidthY - move * 1.2) * YY);\r
-          poly.push(x1 + kage.kMinWidthT * 0.5 * XX + (kage.kMinWidthY * 3 - move * 0.8) * YX,\r
-                    y1 + kage.kMinWidthT * 0.5 * XY + (kage.kMinWidthY * 3 - move * 0.8) * YY);\r
+          poly.push(x1 + kMinWidthT * XX - move * YX,\r
+                    y1 + kMinWidthT * XY - move * YY);\r
+          poly.push(x1 + kMinWidthT * 1.5 * XX + (kage.kMinWidthY - move * 1.2) * YX,\r
+                    y1 + kMinWidthT * 1.5 * XY + (kage.kMinWidthY - move * 1.2) * YY);\r
+          poly.push(x1 + kMinWidthT * 0.5 * XX + (kage.kMinWidthY * 3 - move * 0.8) * YX,\r
+                    y1 + kMinWidthT * 0.5 * XY + (kage.kMinWidthY * 3 - move * 0.8) * YY);\r
           polygons.push(poly);\r
         }\r
       }\r
       else{ //from bottom to up\r
         if(x1 == sx1){\r
           poly = new Polygon();\r
-          poly.push(x1 - kage.kMinWidthT, y1);\r
-          poly.push(x1 - kage.kMinWidthT * 1.5, y1 + kage.kMinWidthY);\r
-          poly.push(x1 - kage.kMinWidthT * 0.5, y1 + kage.kMinWidthY * 3);\r
+          poly.push(x1 - kMinWidthT, y1);\r
+          poly.push(x1 - kMinWidthT * 1.5, y1 + kage.kMinWidthY);\r
+          poly.push(x1 - kMinWidthT * 0.5, y1 + kage.kMinWidthY * 3);\r
           polygons.push(poly);\r
         }\r
         else{\r
           poly = new Polygon();\r
-          poly.push(x1 - kage.kMinWidthT * XX, y1 - kage.kMinWidthT * XY);\r
-          poly.push(x1 - kage.kMinWidthT * 1.5 * XX + kage.kMinWidthY * YX, y1 + kage.kMinWidthY * YY - kage.kMinWidthT * 1.5 * XY);\r
-          poly.push(x1 - kage.kMinWidthT * 0.5 * XX + kage.kMinWidthY * 3 * YX, y1 + kage.kMinWidthY * 3 * YY - kage.kMinWidthT * 0.5 * XY);\r
+          poly.push(x1 - kMinWidthT * XX, y1 - kMinWidthT * XY);\r
+          poly.push(x1 - kMinWidthT * 1.5 * XX + kage.kMinWidthY * YX, y1 + kage.kMinWidthY * YY - kMinWidthT * 1.5 * XY);\r
+          poly.push(x1 - kMinWidthT * 0.5 * XX + kage.kMinWidthY * 3 * YX, y1 + kage.kMinWidthY * 3 * YY - kMinWidthT * 0.5 * XY);\r
           polygons.push(poly);\r
         }\r
       }\r
@@ -432,18 +446,18 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
         poly = new Polygon();\r
         if(kage.kUseCurve){\r
           // by curve path\r
-          poly.push(x2 - kage.kMinWidthT, y2);\r
-          poly.push(x2 - kage.kMinWidthT, y2 + kage.kMinWidthT, 1);\r
-          poly.push(x2, y2 + kage.kMinWidthT);\r
-          poly.push(x2 + kage.kMinWidthT, y2 + kage.kMinWidthT, 1);\r
-          poly.push(x2 + kage.kMinWidthT, y2);\r
+          poly.push(x2 - kMinWidthT, y2);\r
+          poly.push(x2 - kMinWidthT, y2 + kMinWidthT, 1);\r
+          poly.push(x2, y2 + kMinWidthT);\r
+          poly.push(x2 + kMinWidthT, y2 + kMinWidthT, 1);\r
+          poly.push(x2 + kMinWidthT, y2);\r
         } else {\r
           // by polygon\r
-          poly.push(x2 - kage.kMinWidthT, y2);\r
-          poly.push(x2 - kage.kMinWidthT * 0.7, y2 + kage.kMinWidthT * 0.7);\r
-          poly.push(x2, y2 + kage.kMinWidthT);\r
-          poly.push(x2 + kage.kMinWidthT * 0.7, y2 + kage.kMinWidthT * 0.7);\r
-          poly.push(x2 + kage.kMinWidthT, y2);\r
+          poly.push(x2 - kMinWidthT, y2);\r
+          poly.push(x2 - kMinWidthT * 0.7, y2 + kMinWidthT * 0.7);\r
+          poly.push(x2, y2 + kMinWidthT);\r
+          poly.push(x2 + kMinWidthT * 0.7, y2 + kMinWidthT * 0.7);\r
+          poly.push(x2 + kMinWidthT, y2);\r
         }\r
         polygons.push(poly);\r
       }\r
@@ -451,39 +465,39 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
         poly = new Polygon();\r
         if(kage.kUseCurve){\r
           // by curve path\r
-          poly.push(x2 - kage.kMinWidthT, y2);\r
-          poly.push(x2 - kage.kMinWidthT, y2 + kage.kMinWidthT, 1);\r
-          poly.push(x2, y2 + kage.kMinWidthT);\r
-          poly.push(x2 + kage.kMinWidthT, y2 + kage.kMinWidthT, 1);\r
-          poly.push(x2 + kage.kMinWidthT, y2);\r
+          poly.push(x2 - kMinWidthT, y2);\r
+          poly.push(x2 - kMinWidthT, y2 + kMinWidthT, 1);\r
+          poly.push(x2, y2 + kMinWidthT);\r
+          poly.push(x2 + kMinWidthT, y2 + kMinWidthT, 1);\r
+          poly.push(x2 + kMinWidthT, y2);\r
         } else {\r
           // by polygon\r
-          poly.push(x2, y2 - kage.kMinWidthT);\r
-          poly.push(x2 + kage.kMinWidthT * 0.7, y2 - kage.kMinWidthT * 0.7);\r
-          poly.push(x2 + kage.kMinWidthT, y2);\r
-          poly.push(x2 + kage.kMinWidthT * 0.7, y2 + kage.kMinWidthT * 0.7);\r
-          poly.push(x2, y2 + kage.kMinWidthT);\r
+          poly.push(x2, y2 - kMinWidthT);\r
+          poly.push(x2 + kMinWidthT * 0.7, y2 - kMinWidthT * 0.7);\r
+          poly.push(x2 + kMinWidthT, y2);\r
+          poly.push(x2 + kMinWidthT * 0.7, y2 + kMinWidthT * 0.7);\r
+          poly.push(x2, y2 + kMinWidthT);\r
         }\r
         polygons.push(poly);\r
       }\r
       else{\r
         poly = new Polygon();\r
         if(kage.kUseCurve){\r
-          poly.push(x2 + Math.sin(rad) * kage.kMinWidthT * v, y2 - Math.cos(rad) * kage.kMinWidthT * v);\r
-          poly.push(x2 + Math.cos(rad) * kage.kMinWidthT * 0.9 * v + Math.sin(rad) * kage.kMinWidthT * 0.9 * v,\r
-                    y2 + Math.sin(rad) * kage.kMinWidthT * 0.9 * v - Math.cos(rad) * kage.kMinWidthT * 0.9 * v, 1);\r
-          poly.push(x2 + Math.cos(rad) * kage.kMinWidthT * v, y2 + Math.sin(rad) * kage.kMinWidthT * v);\r
-          poly.push(x2 + Math.cos(rad) * kage.kMinWidthT * 0.9 * v - Math.sin(rad) * kage.kMinWidthT * 0.9 * v,\r
-                    y2 + Math.sin(rad) * kage.kMinWidthT * 0.9 * v + Math.cos(rad) * kage.kMinWidthT * 0.9 * v, 1);\r
-          poly.push(x2 - Math.sin(rad) * kage.kMinWidthT * v, y2 + Math.cos(rad) * kage.kMinWidthT * v);\r
+          poly.push(x2 + Math.sin(rad) * kMinWidthT * v, y2 - Math.cos(rad) * kMinWidthT * v);\r
+          poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.9 * v + Math.sin(rad) * kMinWidthT * 0.9 * v,\r
+                    y2 + Math.sin(rad) * kMinWidthT * 0.9 * v - Math.cos(rad) * kMinWidthT * 0.9 * v, 1);\r
+          poly.push(x2 + Math.cos(rad) * kMinWidthT * v, y2 + Math.sin(rad) * kMinWidthT * v);\r
+          poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.9 * v - Math.sin(rad) * kMinWidthT * 0.9 * v,\r
+                    y2 + Math.sin(rad) * kMinWidthT * 0.9 * v + Math.cos(rad) * kMinWidthT * 0.9 * v, 1);\r
+          poly.push(x2 - Math.sin(rad) * kMinWidthT * v, y2 + Math.cos(rad) * kMinWidthT * v);\r
         } else {\r
-          poly.push(x2 + Math.sin(rad) * kage.kMinWidthT * v, y2 - Math.cos(rad) * kage.kMinWidthT * v);\r
-          poly.push(x2 + Math.cos(rad) * kage.kMinWidthT * 0.7 * v + Math.sin(rad) * kage.kMinWidthT * 0.7 * v,\r
-                    y2 + Math.sin(rad) * kage.kMinWidthT * 0.7 * v - Math.cos(rad) * kage.kMinWidthT * 0.7 * v);\r
-          poly.push(x2 + Math.cos(rad) * kage.kMinWidthT * v, y2 + Math.sin(rad) * kage.kMinWidthT * v);\r
-          poly.push(x2 + Math.cos(rad) * kage.kMinWidthT * 0.7 * v - Math.sin(rad) * kage.kMinWidthT * 0.7 * v,\r
-                    y2 + Math.sin(rad) * kage.kMinWidthT * 0.7 * v + Math.cos(rad) * kage.kMinWidthT * 0.7 * v);\r
-          poly.push(x2 - Math.sin(rad) * kage.kMinWidthT * v, y2 + Math.cos(rad) * kage.kMinWidthT * v);\r
+          poly.push(x2 + Math.sin(rad) * kMinWidthT * v, y2 - Math.cos(rad) * kMinWidthT * v);\r
+          poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.7 * v + Math.sin(rad) * kMinWidthT * 0.7 * v,\r
+                    y2 + Math.sin(rad) * kMinWidthT * 0.7 * v - Math.cos(rad) * kMinWidthT * 0.7 * v);\r
+          poly.push(x2 + Math.cos(rad) * kMinWidthT * v, y2 + Math.sin(rad) * kMinWidthT * v);\r
+          poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.7 * v - Math.sin(rad) * kMinWidthT * 0.7 * v,\r
+                    y2 + Math.sin(rad) * kMinWidthT * 0.7 * v + Math.cos(rad) * kMinWidthT * 0.7 * v);\r
+          poly.push(x2 - Math.sin(rad) * kMinWidthT * v, y2 + Math.cos(rad) * kMinWidthT * v);\r
         }\r
         polygons.push(poly);\r
       }\r
@@ -504,17 +518,17 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
       }\r
       if(sy2 == y2){\r
         poly = new Polygon();\r
-        poly.push(x2, y2 + kage.kMinWidthT * kage.kL2RDfatten);\r
-        poly.push(x2, y2 - kage.kMinWidthT * kage.kL2RDfatten);\r
-        poly.push(x2 + kage.kMinWidthT * kage.kL2RDfatten * Math.abs(type), y2 + kage.kMinWidthT * kage.kL2RDfatten * pm);\r
+        poly.push(x2, y2 + kMinWidthT * kage.kL2RDfatten);\r
+        poly.push(x2, y2 - kMinWidthT * kage.kL2RDfatten);\r
+        poly.push(x2 + kMinWidthT * kage.kL2RDfatten * Math.abs(type), y2 + kMinWidthT * kage.kL2RDfatten * pm);\r
         polygons.push(poly);\r
       }\r
       else{\r
         poly = new Polygon();\r
-        poly.push(x2 + kage.kMinWidthT * kage.kL2RDfatten * YX, y2 + kage.kMinWidthT * kage.kL2RDfatten * YY);\r
-        poly.push(x2 - kage.kMinWidthT * kage.kL2RDfatten * YX, y2 - kage.kMinWidthT * kage.kL2RDfatten * YY);\r
-        poly.push(x2 + kage.kMinWidthT * kage.kL2RDfatten * Math.abs(type) * XX + kage.kMinWidthT * kage.kL2RDfatten * pm * YX,\r
-                  y2 + kage.kMinWidthT * kage.kL2RDfatten * Math.abs(type) * XY + kage.kMinWidthT * kage.kL2RDfatten * pm * YY);\r
+        poly.push(x2 + kMinWidthT * kage.kL2RDfatten * YX, y2 + kMinWidthT * kage.kL2RDfatten * YY);\r
+        poly.push(x2 - kMinWidthT * kage.kL2RDfatten * YX, y2 - kMinWidthT * kage.kL2RDfatten * YY);\r
+        poly.push(x2 + kMinWidthT * kage.kL2RDfatten * Math.abs(type) * XX + kMinWidthT * kage.kL2RDfatten * pm * YX,\r
+                  y2 + kMinWidthT * kage.kL2RDfatten * Math.abs(type) * XY + kMinWidthT * kage.kL2RDfatten * pm * YY);\r
         polygons.push(poly);\r
       }\r
     }\r
@@ -522,31 +536,31 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, a1, a2
     if(a2 == 15){ //jump up ... it can change 15->5\r
       if(sy2 == y2){\r
         poly = new Polygon();\r
-        poly.push(x2, y2 - kage.kMinWidthT + 1);\r
-        poly.push(x2 + 2, y2 - kage.kMinWidthT - kage.kWidth * 5);\r
-        poly.push(x2, y2 - kage.kMinWidthT - kage.kWidth * 5);\r
-        poly.push(x2 - kage.kMinWidthT, y2 - kage.kMinWidthT + 1);\r
+        poly.push(x2, y2 - kMinWidthT + 1);\r
+        poly.push(x2 + 2, y2 - kMinWidthT - kage.kWidth * 5);\r
+        poly.push(x2, y2 - kMinWidthT - kage.kWidth * 5);\r
+        poly.push(x2 - kMinWidthT, y2 - kMinWidthT + 1);\r
         polygons.push(poly);\r
       }\r
       else{\r
         poly = new Polygon();\r
-        poly.push(x2 + (kage.kMinWidthT - 1) * Math.sin(rad) * v, y2 - (kage.kMinWidthT - 1) * Math.cos(rad) * v);\r
-        poly.push(x2 + 2 * Math.cos(rad) * v + (kage.kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
-                  y2 + 2 * Math.sin(rad) * v - (kage.kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
-        poly.push(x2 + (kage.kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
-                  y2 - (kage.kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
-        poly.push(x2 + (kage.kMinWidthT - 1) * Math.sin(rad) * v - kage.kMinWidthT * Math.cos(rad) * v,\r
-                  y2 - (kage.kMinWidthT - 1) * Math.cos(rad) * v - kage.kMinWidthT * Math.sin(rad) * v);\r
+        poly.push(x2 + (kMinWidthT - 1) * Math.sin(rad) * v, y2 - (kMinWidthT - 1) * Math.cos(rad) * v);\r
+        poly.push(x2 + 2 * Math.cos(rad) * v + (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
+                  y2 + 2 * Math.sin(rad) * v - (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
+        poly.push(x2 + (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
+                  y2 - (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
+        poly.push(x2 + (kMinWidthT - 1) * Math.sin(rad) * v - kMinWidthT * Math.cos(rad) * v,\r
+                  y2 - (kMinWidthT - 1) * Math.cos(rad) * v - kMinWidthT * Math.sin(rad) * v);\r
         polygons.push(poly);\r
       }\r
     }\r
     \r
-    if(a2 == 14){ //jump to left, allways go left ... it can change 14->4\r
+    if(a2 == 14){ //jump to left, allways go left\r
       poly = new Polygon();\r
       poly.push(x2, y2);\r
-      poly.push(x2, y2 - kage.kMinWidthT);\r
-      poly.push(x2 - kage.kWidth * 4, y2 - kage.kMinWidthT);\r
-      poly.push(x2 - kage.kWidth * 4, y2 - kage.kMinWidthT * 0.5);\r
+      poly.push(x2, y2 - kMinWidthT);\r
+      poly.push(x2 - kage.kWidth * 4 * Math.pow(kMinWidthT / kage.kMinWidthT, 3), y2 - kMinWidthT);\r
+      poly.push(x2 - kage.kWidth * 4 * Math.pow(kMinWidthT / kage.kMinWidthT, 3), y2 - kMinWidthT * 0.5);\r
       polygons.push(poly);\r
     }\r
   }\r
@@ -711,6 +725,7 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){
   var a1, a2, opt1, opt2;\r
   var XX, XY, YX, YY;\r
   var poly;\r
+  var kMinWidthT;\r
   \r
   if(kage.kShotai == kage.kMincho){ //mincho\r
     x1 = tx1;\r
@@ -722,55 +737,57 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){
     opt1 = Math.floor(ta1 / 100);\r
     opt2 = Math.floor(ta2 / 100);\r
     \r
+    kMinWidthT = kage.kMinWidthT - opt1 / 2;\r
+    \r
     if(x1 == x2){ //if TATE stroke, use y-axis\r
       poly = new Polygon(4);\r
       switch(a1){\r
       case 0:\r
-        poly.set(3, x1 - kage.kMinWidthT, y1 - kage.kMinWidthY / 2);\r
-        poly.set(0, x1 + kage.kMinWidthT, y1 + kage.kMinWidthY / 2);\r
+        poly.set(3, x1 - kMinWidthT, y1 - kage.kMinWidthY / 2);\r
+        poly.set(0, x1 + kMinWidthT, y1 + kage.kMinWidthY / 2);\r
         break;\r
       case 1:\r
       case 6: //... no need\r
       case 22:\r
-        poly.set(3, x1 - kage.kMinWidthT, y1);\r
-        poly.set(0, x1 + kage.kMinWidthT, y1);\r
+        poly.set(3, x1 - kMinWidthT, y1);\r
+        poly.set(0, x1 + kMinWidthT, y1);\r
         break;\r
       case 12:\r
-        poly.set(3, x1 - kage.kMinWidthT, y1 - kage.kMinWidthY - kage.kMinWidthT);\r
-        poly.set(0, x1 + kage.kMinWidthT, y1 - kage.kMinWidthY);\r
+        poly.set(3, x1 - kMinWidthT, y1 - kage.kMinWidthY - kMinWidthT);\r
+        poly.set(0, x1 + kMinWidthT, y1 - kage.kMinWidthY);\r
         break;\r
       case 32:\r
-        poly.set(3, x1 - kage.kMinWidthT, y1 - kage.kMinWidthY);\r
-        poly.set(0, x1 + kage.kMinWidthT, y1 - kage.kMinWidthY);\r
+        poly.set(3, x1 - kMinWidthT, y1 - kage.kMinWidthY);\r
+        poly.set(0, x1 + kMinWidthT, y1 - kage.kMinWidthY);\r
         break;\r
       }\r
       \r
       switch(a2){\r
       case 0:\r
         if(a1 == 6){ //KAGI's tail ... no need\r
-          poly.set(2, x2 - kage.kMinWidthT, y2);\r
-          poly.set(1, x2 + kage.kMinWidthT, y2);\r
+          poly.set(2, x2 - kMinWidthT, y2);\r
+          poly.set(1, x2 + kMinWidthT, y2);\r
         }\r
         else{\r
-          poly.set(2, x2 - kage.kMinWidthT, y2 + kage.kMinWidthT / 2);\r
-          poly.set(1, x2 + kage.kMinWidthT, y2 - kage.kMinWidthT / 2);\r
+          poly.set(2, x2 - kMinWidthT, y2 + kMinWidthT / 2);\r
+          poly.set(1, x2 + kMinWidthT, y2 - kMinWidthT / 2);\r
         }\r
         break;\r
       case 1:\r
-        poly.set(2, x2 - kage.kMinWidthT, y2);\r
-        poly.set(1, x2 + kage.kMinWidthT, y2);\r
+        poly.set(2, x2 - kMinWidthT, y2);\r
+        poly.set(1, x2 + kMinWidthT, y2);\r
         break;\r
       case 13:\r
-        poly.set(2, x2 - kage.kMinWidthT, y2 + kage.kAdjustKakatoL[opt2] + kage.kMinWidthT);\r
-        poly.set(1, x2 + kage.kMinWidthT, y2 + kage.kAdjustKakatoL[opt2]);\r
+        poly.set(2, x2 - kMinWidthT, y2 + kage.kAdjustKakatoL[opt2] + kMinWidthT);\r
+        poly.set(1, x2 + kMinWidthT, y2 + kage.kAdjustKakatoL[opt2]);\r
         break;\r
       case 23:\r
-        poly.set(2, x2 - kage.kMinWidthT, y2 + kage.kAdjustKakatoR[opt2] + kage.kMinWidthT);\r
-        poly.set(1, x2 + kage.kMinWidthT, y2 + kage.kAdjustKakatoR[opt2]);\r
+        poly.set(2, x2 - kMinWidthT, y2 + kage.kAdjustKakatoR[opt2] + kMinWidthT);\r
+        poly.set(1, x2 + kMinWidthT, y2 + kage.kAdjustKakatoR[opt2]);\r
         break;\r
       case 32:\r
-        poly.set(2, x2 - kage.kMinWidthT, y2 + kage.kMinWidthY);\r
-        poly.set(1, x2 + kage.kMinWidthT, y2 + kage.kMinWidthY);\r
+        poly.set(2, x2 - kMinWidthT, y2 + kage.kMinWidthY);\r
+        poly.set(1, x2 + kMinWidthT, y2 + kage.kMinWidthY);\r
         break;\r
       }\r
       \r
@@ -778,29 +795,29 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){
       \r
       if(a1 == 22){ //box's right top corner\r
         poly = new Polygon();\r
-        poly.push(x1 - kage.kMinWidthT, y1 - kage.kMinWidthY);\r
+        poly.push(x1 - kMinWidthT, y1 - kage.kMinWidthY);\r
         poly.push(x1, y1 - kage.kMinWidthY - kage.kWidth);\r
-        poly.push(x1 + kage.kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY);\r
-        poly.push(x1 + kage.kMinWidthT, y1 + kage.kMinWidthT);\r
-        poly.push(x1 - kage.kMinWidthT, y1);\r
+        poly.push(x1 + kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY);\r
+        poly.push(x1 + kMinWidthT, y1 + kMinWidthT);\r
+        poly.push(x1 - kMinWidthT, y1);\r
         polygons.push(poly);\r
       }\r
       \r
       if(a1 == 0){ //beginning of the stroke\r
         poly = new Polygon();\r
-        poly.push(x1 + kage.kMinWidthT, y1 + kage.kMinWidthY * 0.5);\r
-        poly.push(x1 + kage.kMinWidthT + kage.kMinWidthT * 0.5, y1 + kage.kMinWidthY * 0.5 + kage.kMinWidthY);\r
-        poly.push(x1 + kage.kMinWidthT, y1 + kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2);\r
+        poly.push(x1 + kMinWidthT, y1 + kage.kMinWidthY * 0.5);\r
+        poly.push(x1 + kMinWidthT + kMinWidthT * 0.5, y1 + kage.kMinWidthY * 0.5 + kage.kMinWidthY);\r
+        poly.push(x1 + kMinWidthT, y1 + kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2);\r
         polygons.push(poly);\r
       }\r
       \r
       if((a1 == 6 && a2 == 0) || a2 == 1){ //KAGI NO YOKO BOU NO SAIGO NO MARU ... no need only used at 1st=yoko\r
         poly = new Polygon();\r
-        poly.push(x2 - kage.kMinWidthT, y2);\r
-        poly.push(x2 - kage.kMinWidthT * 0.6, y2 + kage.kMinWidthT * 0.6);\r
-        poly.push(x2, y2 + kage.kMinWidthT);\r
-        poly.push(x2 + kage.kMinWidthT * 0.6, y2 + kage.kMinWidthT * 0.6);\r
-        poly.push(x2 + kage.kMinWidthT, y2);\r
+        poly.push(x2 - kMinWidthT, y2);\r
+        poly.push(x2 - kMinWidthT * 0.6, y2 + kMinWidthT * 0.6);\r
+        poly.push(x2, y2 + kMinWidthT);\r
+        poly.push(x2 + kMinWidthT * 0.6, y2 + kMinWidthT * 0.6);\r
+        poly.push(x2 + kMinWidthT, y2);\r
         poly.reverse(); // for fill-rule\r
         polygons.push(poly);\r
       }\r
@@ -808,30 +825,30 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){
     else if(y1 == y2){ //if it is YOKO stroke, use x-axis\r
       if(a1 == 6){ //if it is KAGI's YOKO stroke, get bold\r
         poly = new Polygon();\r
-        poly.push(x1, y1 - kage.kMinWidthT);\r
-        poly.push(x2, y2 - kage.kMinWidthT);\r
-        poly.push(x2, y2 + kage.kMinWidthT);\r
-        poly.push(x1, y1 + kage.kMinWidthT);\r
+        poly.push(x1, y1 - kMinWidthT);\r
+        poly.push(x2, y2 - kMinWidthT);\r
+        poly.push(x2, y2 + kMinWidthT);\r
+        poly.push(x1, y1 + kMinWidthT);\r
         polygons.push(poly);\r
         \r
         if(a2 == 1 || a2 == 0 || a2 == 5){ // no need a2=1\r
           //KAGI NO YOKO BOU NO SAIGO NO MARU\r
           poly = new Polygon();\r
-          poly.push(x2, y2 - kage.kMinWidthT);\r
-          poly.push(x2 + kage.kMinWidthT * 0.6, y2 - kage.kMinWidthT * 0.6);\r
-          poly.push(x2 + kage.kMinWidthT, y2);\r
-          poly.push(x2 + kage.kMinWidthT * 0.6, y2 + kage.kMinWidthT * 0.6);\r
-          poly.push(x2, y2 + kage.kMinWidthT);\r
+          poly.push(x2, y2 - kMinWidthT);\r
+          poly.push(x2 + kMinWidthT * 0.6, y2 - kMinWidthT * 0.6);\r
+          poly.push(x2 + kMinWidthT, y2);\r
+          poly.push(x2 + kMinWidthT * 0.6, y2 + kMinWidthT * 0.6);\r
+          poly.push(x2, y2 + kMinWidthT);\r
           polygons.push(poly);\r
         }\r
         \r
         if(a2 == 5){\r
           //KAGI NO YOKO BOU NO HANE\r
           poly = new Polygon();\r
-          poly.push(x2, y2 - kage.kMinWidthT + 1);\r
-          poly.push(x2 + 2, y2 - kage.kMinWidthT - kage.kWidth * 5);\r
-          poly.push(x2, y2 - kage.kMinWidthT - kage.kWidth * 5);\r
-          poly.push(x2 - kage.kMinWidthT, y2 - kage.kMinWidthT + 1);\r
+          poly.push(x2, y2 - kMinWidthT + 1);\r
+          poly.push(x2 + 2, y2 - kMinWidthT - kage.kWidth * 5);\r
+          poly.push(x2, y2 - kMinWidthT - kage.kWidth * 5);\r
+          poly.push(x2 - kMinWidthT, y2 - kMinWidthT + 1);\r
           poly.reverse(); // for fill-rule\r
           polygons.push(poly);\r
         }\r
@@ -881,67 +898,67 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){
         poly = new Polygon(4);\r
         switch(a1){\r
         case 0:\r
-          poly.set(0, x1 + Math.sin(rad) * kage.kMinWidthT * v + kage.kMinWidthY * Math.cos(rad) * 0.5 * v,\r
-                   y1 - Math.cos(rad) * kage.kMinWidthT * v + kage.kMinWidthY * Math.sin(rad) * 0.5 * v);\r
-          poly.set(3, x1 - Math.sin(rad) * kage.kMinWidthT * v - kage.kMinWidthY * Math.cos(rad) * 0.5 * v,\r
-                   y1 + Math.cos(rad) * kage.kMinWidthT * v - kage.kMinWidthY * Math.sin(rad) * 0.5 * v);\r
+          poly.set(0, x1 + Math.sin(rad) * kMinWidthT * v + kage.kMinWidthY * Math.cos(rad) * 0.5 * v,\r
+                   y1 - Math.cos(rad) * kMinWidthT * v + kage.kMinWidthY * Math.sin(rad) * 0.5 * v);\r
+          poly.set(3, x1 - Math.sin(rad) * kMinWidthT * v - kage.kMinWidthY * Math.cos(rad) * 0.5 * v,\r
+                   y1 + Math.cos(rad) * kMinWidthT * v - kage.kMinWidthY * Math.sin(rad) * 0.5 * v);\r
           break;\r
         case 1:\r
         case 6:\r
         case 22:\r
-          poly.set(0, x1 + Math.sin(rad) * kage.kMinWidthT * v, y1 - Math.cos(rad) * kage.kMinWidthT * v);\r
-          poly.set(3, x1 - Math.sin(rad) * kage.kMinWidthT * v, y1 + Math.cos(rad) * kage.kMinWidthT * v);\r
+          poly.set(0, x1 + Math.sin(rad) * kMinWidthT * v, y1 - Math.cos(rad) * kMinWidthT * v);\r
+          poly.set(3, x1 - Math.sin(rad) * kMinWidthT * v, y1 + Math.cos(rad) * kMinWidthT * v);\r
           break;\r
         case 12:\r
-          poly.set(0, x1 + Math.sin(rad) * kage.kMinWidthT * v - kage.kMinWidthY * Math.cos(rad) * v,\r
-                   y1 - Math.cos(rad) * kage.kMinWidthT * v - kage.kMinWidthY * Math.sin(rad) * v);\r
-          poly.set(3, x1 - Math.sin(rad) * kage.kMinWidthT * v - (kage.kMinWidthT + kage.kMinWidthY) * Math.cos(rad) * v,\r
-                   y1 + Math.cos(rad) * kage.kMinWidthT * v - (kage.kMinWidthT + kage.kMinWidthY) * Math.sin(rad) * v);\r
+          poly.set(0, x1 + Math.sin(rad) * kMinWidthT * v - kage.kMinWidthY * Math.cos(rad) * v,\r
+                   y1 - Math.cos(rad) * kMinWidthT * v - kage.kMinWidthY * Math.sin(rad) * v);\r
+          poly.set(3, x1 - Math.sin(rad) * kMinWidthT * v - (kMinWidthT + kage.kMinWidthY) * Math.cos(rad) * v,\r
+                   y1 + Math.cos(rad) * kMinWidthT * v - (kMinWidthT + kage.kMinWidthY) * Math.sin(rad) * v);\r
           break;\r
         case 32:\r
-          poly.set(0, x1 + Math.sin(rad) * kage.kMinWidthT * v - kage.kMinWidthY * Math.cos(rad) * v,\r
-                   y1 - Math.cos(rad) * kage.kMinWidthT * v - kage.kMinWidthY * Math.sin(rad) * v);\r
-          poly.set(3, x1 - Math.sin(rad) * kage.kMinWidthT * v - kage.kMinWidthY * Math.cos(rad) * v,\r
-                   y1 + Math.cos(rad) * kage.kMinWidthT * v - kage.kMinWidthY * Math.sin(rad) * v);\r
+          poly.set(0, x1 + Math.sin(rad) * kMinWidthT * v - kage.kMinWidthY * Math.cos(rad) * v,\r
+                   y1 - Math.cos(rad) * kMinWidthT * v - kage.kMinWidthY * Math.sin(rad) * v);\r
+          poly.set(3, x1 - Math.sin(rad) * kMinWidthT * v - kage.kMinWidthY * Math.cos(rad) * v,\r
+                   y1 + Math.cos(rad) * kMinWidthT * v - kage.kMinWidthY * Math.sin(rad) * v);\r
           break;\r
         }\r
         \r
         switch(a2){\r
         case 0:\r
           if(a1 == 6){\r
-            poly.set(1, x2 + Math.sin(rad) * kage.kMinWidthT * v, y2 - Math.cos(rad) * kage.kMinWidthT * v);\r
-            poly.set(2, x2 - Math.sin(rad) * kage.kMinWidthT * v, y2 + Math.cos(rad) * kage.kMinWidthT * v);\r
+            poly.set(1, x2 + Math.sin(rad) * kMinWidthT * v, y2 - Math.cos(rad) * kMinWidthT * v);\r
+            poly.set(2, x2 - Math.sin(rad) * kMinWidthT * v, y2 + Math.cos(rad) * kMinWidthT * v);\r
           }\r
           else{\r
-            poly.set(1, x2 + Math.sin(rad) * kage.kMinWidthT * v - kage.kMinWidthT * 0.5 * Math.cos(rad) * v,\r
-                     y2 - Math.cos(rad) * kage.kMinWidthT * v - kage.kMinWidthT * 0.5 * Math.sin(rad) * v);\r
-            poly.set(2, x2 - Math.sin(rad) * kage.kMinWidthT * v + kage.kMinWidthT * 0.5 * Math.cos(rad) * v,\r
-                     y2 + Math.cos(rad) * kage.kMinWidthT * v + kage.kMinWidthT * 0.5 * Math.sin(rad) * v);\r
+            poly.set(1, x2 + Math.sin(rad) * kMinWidthT * v - kMinWidthT * 0.5 * Math.cos(rad) * v,\r
+                     y2 - Math.cos(rad) * kMinWidthT * v - kMinWidthT * 0.5 * Math.sin(rad) * v);\r
+            poly.set(2, x2 - Math.sin(rad) * kMinWidthT * v + kMinWidthT * 0.5 * Math.cos(rad) * v,\r
+                     y2 + Math.cos(rad) * kMinWidthT * v + kMinWidthT * 0.5 * Math.sin(rad) * v);\r
           }\r
           break;\r
         case 1: // is needed?\r
         case 5:\r
-          poly.set(1, x2 + Math.sin(rad) * kage.kMinWidthT * v, y2 - Math.cos(rad) * kage.kMinWidthT * v);\r
-          poly.set(2, x2 - Math.sin(rad) * kage.kMinWidthT * v, y2 + Math.cos(rad) * kage.kMinWidthT * v);\r
+          poly.set(1, x2 + Math.sin(rad) * kMinWidthT * v, y2 - Math.cos(rad) * kMinWidthT * v);\r
+          poly.set(2, x2 - Math.sin(rad) * kMinWidthT * v, y2 + Math.cos(rad) * kMinWidthT * v);\r
           break;\r
         case 13:\r
-          poly.set(1, x2 + Math.sin(rad) * kage.kMinWidthT * v + kage.kAdjustKakatoL[opt2] * Math.cos(rad) * v,\r
-                   y2 - Math.cos(rad) * kage.kMinWidthT * v + kage.kAdjustKakatoL[opt2] * Math.sin(rad) * v);\r
-          poly.set(2, x2 - Math.sin(rad) * kage.kMinWidthT * v + (kage.kAdjustKakatoL[opt2] + kage.kMinWidthT) * Math.cos(rad) * v,\r
-                   y2 + Math.cos(rad) * kage.kMinWidthT * v + (kage.kAdjustKakatoL[opt2] + kage.kMinWidthT) * Math.sin(rad) * v);\r
+          poly.set(1, x2 + Math.sin(rad) * kMinWidthT * v + kage.kAdjustKakatoL[opt2] * Math.cos(rad) * v,\r
+                   y2 - Math.cos(rad) * kMinWidthT * v + kage.kAdjustKakatoL[opt2] * Math.sin(rad) * v);\r
+          poly.set(2, x2 - Math.sin(rad) * kMinWidthT * v + (kage.kAdjustKakatoL[opt2] + kMinWidthT) * Math.cos(rad) * v,\r
+                   y2 + Math.cos(rad) * kMinWidthT * v + (kage.kAdjustKakatoL[opt2] + kMinWidthT) * Math.sin(rad) * v);\r
           break;\r
         case 23:\r
-          poly.set(1, x2 + Math.sin(rad) * kage.kMinWidthT * v + kage.kAdjustKakatoR[opt2] * Math.cos(rad) * v,\r
-                   y2 - Math.cos(rad) * kage.kMinWidthT * v + kage.kAdjustKakatoR[opt2] * Math.sin(rad) * v);\r
+          poly.set(1, x2 + Math.sin(rad) * kMinWidthT * v + kage.kAdjustKakatoR[opt2] * Math.cos(rad) * v,\r
+                   y2 - Math.cos(rad) * kMinWidthT * v + kage.kAdjustKakatoR[opt2] * Math.sin(rad) * v);\r
           poly.set(2,\r
-                   x2 - Math.sin(rad) * kage.kMinWidthT * v + (kage.kAdjustKakatoR[opt2] + kage.kMinWidthT) * Math.cos(rad) * v,\r
-                   y2 + Math.cos(rad) * kage.kMinWidthT * v + (kage.kAdjustKakatoR[opt2] + kage.kMinWidthT) * Math.sin(rad) * v);\r
+                   x2 - Math.sin(rad) * kMinWidthT * v + (kage.kAdjustKakatoR[opt2] + kMinWidthT) * Math.cos(rad) * v,\r
+                   y2 + Math.cos(rad) * kMinWidthT * v + (kage.kAdjustKakatoR[opt2] + kMinWidthT) * Math.sin(rad) * v);\r
           break;\r
         case 32:\r
-          poly.set(1, x2 + Math.sin(rad) * kage.kMinWidthT * v + kage.kMinWidthY * Math.cos(rad) * v,\r
-                   y2 - Math.cos(rad) * kage.kMinWidthT * v + kage.kMinWidthY * Math.sin(rad) * v);\r
-          poly.set(2, x2 - Math.sin(rad) * kage.kMinWidthT * v + kage.kMinWidthY * Math.cos(rad) * v,\r
-                   y2 + Math.cos(rad) * kage.kMinWidthT * v + kage.kMinWidthY * Math.sin(rad) * v);\r
+          poly.set(1, x2 + Math.sin(rad) * kMinWidthT * v + kage.kMinWidthY * Math.cos(rad) * v,\r
+                   y2 - Math.cos(rad) * kMinWidthT * v + kage.kMinWidthY * Math.sin(rad) * v);\r
+          poly.set(2, x2 - Math.sin(rad) * kMinWidthT * v + kage.kMinWidthY * Math.cos(rad) * v,\r
+                   y2 + Math.cos(rad) * kMinWidthT * v + kage.kMinWidthY * Math.sin(rad) * v);\r
           break;\r
         }\r
         \r
@@ -949,36 +966,36 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){
         \r
         if((a1 == 6) && (a2 == 0 || a2 == 5)){ //KAGI NO YOKO BOU NO SAIGO NO MARU\r
           poly = new Polygon();\r
-          poly.push(x2 + Math.sin(rad) * kage.kMinWidthT * v, y2 - Math.cos(rad) * kage.kMinWidthT * v);\r
-          poly.push(x2 + Math.cos(rad) * kage.kMinWidthT * 0.8 * v + Math.sin(rad) * kage.kMinWidthT * 0.6 * v,\r
-                    y2 + Math.sin(rad) * kage.kMinWidthT * 0.8 * v - Math.cos(rad) * kage.kMinWidthT * 0.6 * v);\r
-          poly.push(x2 + Math.cos(rad) * kage.kMinWidthT * v, y2 + Math.sin(rad) * kage.kMinWidthT * v);\r
-          poly.push(x2 + Math.cos(rad) * kage.kMinWidthT * 0.8 * v - Math.sin(rad) * kage.kMinWidthT * 0.6 * v,\r
-                    y2 + Math.sin(rad) * kage.kMinWidthT * 0.8 * v + Math.cos(rad) * kage.kMinWidthT * 0.6 * v);\r
-          poly.push(x2 - Math.sin(rad) * kage.kMinWidthT * v, y2 + Math.cos(rad) * kage.kMinWidthT * v);\r
+          poly.push(x2 + Math.sin(rad) * kMinWidthT * v, y2 - Math.cos(rad) * kMinWidthT * v);\r
+          poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.8 * v + Math.sin(rad) * kMinWidthT * 0.6 * v,\r
+                    y2 + Math.sin(rad) * kMinWidthT * 0.8 * v - Math.cos(rad) * kMinWidthT * 0.6 * v);\r
+          poly.push(x2 + Math.cos(rad) * kMinWidthT * v, y2 + Math.sin(rad) * kMinWidthT * v);\r
+          poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.8 * v - Math.sin(rad) * kMinWidthT * 0.6 * v,\r
+                    y2 + Math.sin(rad) * kMinWidthT * 0.8 * v + Math.cos(rad) * kMinWidthT * 0.6 * v);\r
+          poly.push(x2 - Math.sin(rad) * kMinWidthT * v, y2 + Math.cos(rad) * kMinWidthT * v);\r
           polygons.push(poly);\r
         }\r
         \r
         if(a1 == 6 && a2 == 5){\r
           //KAGI NO YOKO BOU NO HANE\r
           poly = new Polygon();\r
-          poly.push(x2 + (kage.kMinWidthT - 1) * Math.sin(rad) * v, y2 - (kage.kMinWidthT - 1) * Math.cos(rad) * v);\r
-          poly.push(x2 + 2 * Math.cos(rad) * v + (kage.kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
-                    y2 + 2 * Math.sin(rad) * v - (kage.kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
-          poly.push(x2 + (kage.kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
-                    y2 - (kage.kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
-          poly.push(x2 + (kage.kMinWidthT - 1) * Math.sin(rad) * v - kage.kMinWidthT * Math.cos(rad) * v,\r
-                    y2 - (kage.kMinWidthT - 1) * Math.cos(rad) * v - kage.kMinWidthT * Math.sin(rad) * v);\r
+          poly.push(x2 + (kMinWidthT - 1) * Math.sin(rad) * v, y2 - (kMinWidthT - 1) * Math.cos(rad) * v);\r
+          poly.push(x2 + 2 * Math.cos(rad) * v + (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
+                    y2 + 2 * Math.sin(rad) * v - (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
+          poly.push(x2 + (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
+                    y2 - (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
+          poly.push(x2 + (kMinWidthT - 1) * Math.sin(rad) * v - kMinWidthT * Math.cos(rad) * v,\r
+                    y2 - (kMinWidthT - 1) * Math.cos(rad) * v - kMinWidthT * Math.sin(rad) * v);\r
           polygons.push(poly);\r
         }\r
         \r
         if(a1 == 22){ //SHIKAKU MIGIUE UROKO NANAME DEMO MASSUGU MUKI\r
           poly = new Polygon();\r
-          poly.push(x1 - kage.kMinWidthT, y1 - kage.kMinWidthY);\r
+          poly.push(x1 - kMinWidthT, y1 - kage.kMinWidthY);\r
           poly.push(x1, y1 - kage.kMinWidthY - kage.kWidth);\r
-          poly.push(x1 + kage.kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY);\r
-          poly.push(x1 + kage.kMinWidthT, y1 + kage.kMinWidthT);\r
-          poly.push(x1 - kage.kMinWidthT, y1);\r
+          poly.push(x1 + kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY);\r
+          poly.push(x1 + kMinWidthT, y1 + kMinWidthT);\r
+          poly.push(x1 - kMinWidthT, y1);\r
           polygons.push(poly);\r
         }\r
         \r
@@ -989,12 +1006,12 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){
         \r
         if(a1 == 0){ //beginning of the storke\r
           poly = new Polygon();\r
-          poly.push(x1 + kage.kMinWidthT * XX + (kage.kMinWidthY * 0.5) * YX,\r
-                    y1 + kage.kMinWidthT * XY + (kage.kMinWidthY * 0.5) * YY);\r
-          poly.push(x1 + (kage.kMinWidthT + kage.kMinWidthT * 0.5) * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YX,\r
-                    y1 + (kage.kMinWidthT + kage.kMinWidthT * 0.5) * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YY);\r
-          poly.push(x1 + kage.kMinWidthT * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YX,\r
-                    y1 + kage.kMinWidthT * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YY);\r
+          poly.push(x1 + kMinWidthT * XX + (kage.kMinWidthY * 0.5) * YX,\r
+                    y1 + kMinWidthT * XY + (kage.kMinWidthY * 0.5) * YY);\r
+          poly.push(x1 + (kMinWidthT + kMinWidthT * 0.5) * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YX,\r
+                    y1 + (kMinWidthT + kMinWidthT * 0.5) * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YY);\r
+          poly.push(x1 + kMinWidthT * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YX,\r
+                    y1 + kMinWidthT * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YY);\r
           polygons.push(poly);\r
         }\r
       }\r
index cd4da1e..18c86bb 100755 (executable)
@@ -25,7 +25,7 @@ function dfDrawFont(kage, polygons, a1, a2, a3, x1, y1, x2, y2, x3, y3, x4, y4){
           ty1 = y2 - kage.kMage * Math.sin(rad) * v;\r
         }\r
         cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r
-        cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, x2 - kage.kMage, y2, 1, 14);\r
+        cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, x2 - kage.kMage * (((kage.kAdjustTateStep + 4) - Math.floor(a2 / 100)) / (kage.kAdjustTateStep + 4)), y2, 1 + (a2 - a2 % 100), 14);\r
       }\r
       else{\r
         cdDrawLine(kage, polygons, x1, y1, x2, y2, a2, a3);\r
@@ -96,7 +96,7 @@ function dfDrawFont(kage, polygons, a1, a2, a3, x1, y1, x2, y2, x3, y3, x4, y4){
         ty3 = y3;\r
         \r
         cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r
-        cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1, 1);\r
+        cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1 + (a2 - a2 % 100) * 10, 1);\r
         if(tx3 - tx2 > 0){ // for closer position\r
           cdDrawLine(kage, polygons, tx2, ty2, tx3, ty3, 6, 5); // bolder by force\r
         }\r
@@ -135,7 +135,7 @@ function dfDrawFont(kage, polygons, a1, a2, a3, x1, y1, x2, y2, x3, y3, x4, y4){
           ty2 = y2 + kage.kMage * Math.sin(rad) * v;\r
         }\r
         cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r
-        cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1, 1);\r
+        cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1 + (a2 - a2 % 100) * 10, 1);\r
         cdDrawLine(kage, polygons, tx2, ty2, x3, y3, 6, a3); // bolder by force\r
       }\r
       break;\r
@@ -256,7 +256,7 @@ function dfDrawFont(kage, polygons, a1, a2, a3, x1, y1, x2, y2, x3, y3, x4, y4){
       break;\r
     case 7:\r
       cdDrawLine(kage, polygons, x1, y1, x2, y2, a2, 1);\r
-      cdDrawCurve(kage, polygons, x2, y2, x3, y3, x4, y4, 1, a3);\r
+      cdDrawCurve(kage, polygons, x2, y2, x3, y3, x4, y4, 1 + (a2 - a2 % 100), a3);\r
       break;\r
     case 9: // may not be exist ... no need\r
       //kageCanvas[y1][x1] = 0;\r