L2RD Curve: make fatten
authorKoichi KAMICHI <kamichi@fonts.jp>
Fri, 11 Jun 2004 05:06:10 +0000 (05:06 +0000)
committerKoichi KAMICHI <kamichi@fonts.jp>
Fri, 11 Jun 2004 05:06:10 +0000 (05:06 +0000)
kagecgi/kage.h
kagecgi/kagecd.c

index fd69032..38a9f9e 100755 (executable)
@@ -19,6 +19,7 @@ int kShotai;
 #define kKakato 3 //has KAKATO = 2, no KAKATO = 1\r
 #define kKasane 3\r
 #define kMixdot (kWidth * 2) * (kWidth * 2 - 1)\r
+#define kL2RDfatten 1.1\r
 \r
 #define kMaxIDSSequenceLength 16\r
 #define kMaxIDCLength 16\r
index febf612..9168a69 100755 (executable)
@@ -109,15 +109,6 @@ void cdDrawBezier(double x1, double y1,
                        ib = kMinWidthT;\r
                }\r
                \r
-               /*\r
-               if(a1 == 7 && a2 != 17){ deltad = sqrt(t); }\r
-               else if(a2 == 7 && a1 != 17){ deltad = sqrt(1.0 - t); }\r
-               else if(a1 == 7 && a2 == 17){ deltad = sqrt(t / 2); }\r
-               else if(a1 == 17 && a2 != 7){ deltad = sqrt(t / 2 + 0.5); }\r
-               else if(a1 != 7 && a2 == 17){ deltad = sqrt(1.0 - t / 2); }\r
-               else if(a1 == 17 && a2 == 7){ deltad = sqrt(0.5 - t / 2); }\r
-               else{ deltad = 1; }\r
-               */\r
                if(a1 == 7){ deltad = sqrt(t); }\r
                else if(a2 == 7){ deltad = sqrt(1.0 - t); }\r
                else{ deltad = 1; }\r
@@ -322,50 +313,6 @@ void cdDrawBezier(double x1, double y1,
                        }\r
                }\r
                \r
-               /*\r
-               if(a2 == 17){ //the last filled half circle\r
-                       if(x2 == x3){\r
-                               poly3[0].X = x3 - kMinWidthT * 0.5;\r
-                               poly3[0].Y = y3;\r
-                               poly3[1].X = x3 - kMinWidthT * 0.6 * 0.5;\r
-                               poly3[1].Y = y3 + kMinWidthT * 0.6 * 0.5;\r
-                               poly3[2].X = x3;\r
-                               poly3[2].Y = y3 + kMinWidthT * 0.5;\r
-                               poly3[3].X = x3 + kMinWidthT * 0.6 * 0.5;\r
-                               poly3[3].Y = y3 + kMinWidthT * 0.6 * 0.5;\r
-                               poly3[4].X = x3 + kMinWidthT * 0.5;\r
-                               poly3[4].Y = y3;\r
-                               icPolygon(poly3, 5);\r
-                       }\r
-                       else if(y2 == y3){\r
-                               poly3[0].X = x3;\r
-                               poly3[0].Y = y3 - kMinWidthT * 0.5;\r
-                               poly3[1].X = x3 + kMinWidthT * 0.6 * 0.5;\r
-                               poly3[1].Y = y3 - kMinWidthT * 0.6 * 0.5;\r
-                               poly3[2].X = x3 + kMinWidthT * 0.5;\r
-                               poly3[2].Y = y3;\r
-                               poly3[3].X = x3 + kMinWidthT * 0.6 * 0.5;\r
-                               poly3[3].Y = y3 + kMinWidthT * 0.6 * 0.5;\r
-                               poly3[4].X = x3;\r
-                               poly3[4].Y = y3 + kMinWidthT * 0.5;\r
-                               icPolygon(poly3, 5);\r
-                       }\r
-                       else{\r
-                               poly3[0].X = x3 + sin(rad) * kMinWidthT * 0.5 * v;\r
-                               poly3[0].Y = y3 - cos(rad) * kMinWidthT * 0.5 * v;\r
-                               poly3[1].X = x3 + cos(rad) * kMinWidthT * 0.8 * 0.5 * v + sin(rad) * kMinWidthT * 0.6 * 0.5 * v;\r
-                               poly3[1].Y = y3 + sin(rad) * kMinWidthT * 0.8 * 0.5 * v - cos(rad) * kMinWidthT * 0.6 * 0.5 * v;\r
-                               poly3[2].X = x3 + cos(rad) * kMinWidthT * 0.5 * v;\r
-                               poly3[2].Y = y3 + sin(rad) * kMinWidthT * 0.5 * v;\r
-                               poly3[3].X = x3 + cos(rad) * kMinWidthT * 0.5 * 0.8 * v - sin(rad) * kMinWidthT * 0.6 * 0.5 * v;\r
-                               poly3[3].Y = y3 + sin(rad) * kMinWidthT * 0.5 * 0.8 * v + cos(rad) * kMinWidthT * 0.6 * 0.5 * v;\r
-                               poly3[4].X = x3 - sin(rad) * kMinWidthT * 0.5 * v;\r
-                               poly3[4].Y = y3 + cos(rad) * kMinWidthT * 0.5 * v;\r
-                               icPolygon(poly3, 5);\r
-                       }\r
-               }\r
-               */\r
-               \r
                if(a2 == 9 || (a1 == 7 && a2 == 0)){ // Sinnyu & L2RD Harai\r
                        if(y3 == y4){\r
                                poly2[0].X = x4;\r
@@ -675,12 +622,9 @@ void cdDrawCurve(double x1, double y1,
                        ib = kMinWidthT;\r
                }\r
                \r
-               if(a1 == 7 && a2 != 17){ deltad = sqrt(t); }\r
-               else if(a2 == 7 && a1 != 17){ deltad = sqrt(1.0 - t); }\r
-               else if(a1 == 7 && a2 == 17){ deltad = sqrt(t / 2); }\r
-               else if(a1 == 17 && a2 != 7){ deltad = sqrt(t / 2 + 0.5); }\r
-               else if(a1 != 7 && a2 == 17){ deltad = sqrt(1.0 - t / 2); }\r
-               else if(a1 == 17 && a2 == 7){ deltad = sqrt(0.5 - t / 2); }\r
+               if(a1 == 7 && a2 == 0){ deltad = sqrt(t) * kL2RDfatten; } //L2RD: fatten\r
+               else if(a1 == 7){ deltad = sqrt(t); }\r
+               else if(a2 == 7){ deltad = sqrt(1.0 - t); }\r
                else{ deltad = 1; }\r
                ia = ia * deltad;\r
                ib = ib * deltad;\r
@@ -883,65 +827,23 @@ void cdDrawCurve(double x1, double y1,
                        }\r
                }\r
                \r
-               if(a2 == 17){ //the last filled half circle\r
-                       if(x2 == x3){\r
-                               poly3[0].X = x3 - kMinWidthT * 0.5;\r
-                               poly3[0].Y = y3;\r
-                               poly3[1].X = x3 - kMinWidthT * 0.6 * 0.5;\r
-                               poly3[1].Y = y3 + kMinWidthT * 0.6 * 0.5;\r
-                               poly3[2].X = x3;\r
-                               poly3[2].Y = y3 + kMinWidthT * 0.5;\r
-                               poly3[3].X = x3 + kMinWidthT * 0.6 * 0.5;\r
-                               poly3[3].Y = y3 + kMinWidthT * 0.6 * 0.5;\r
-                               poly3[4].X = x3 + kMinWidthT * 0.5;\r
-                               poly3[4].Y = y3;\r
-                               icPolygon(poly3, 5);\r
-                       }\r
-                       else if(y2 == y3){\r
-                               poly3[0].X = x3;\r
-                               poly3[0].Y = y3 - kMinWidthT * 0.5;\r
-                               poly3[1].X = x3 + kMinWidthT * 0.6 * 0.5;\r
-                               poly3[1].Y = y3 - kMinWidthT * 0.6 * 0.5;\r
-                               poly3[2].X = x3 + kMinWidthT * 0.5;\r
-                               poly3[2].Y = y3;\r
-                               poly3[3].X = x3 + kMinWidthT * 0.6 * 0.5;\r
-                               poly3[3].Y = y3 + kMinWidthT * 0.6 * 0.5;\r
-                               poly3[4].X = x3;\r
-                               poly3[4].Y = y3 + kMinWidthT * 0.5;\r
-                               icPolygon(poly3, 5);\r
-                       }\r
-                       else{\r
-                               poly3[0].X = x3 + sin(rad) * kMinWidthT * 0.5 * v;\r
-                               poly3[0].Y = y3 - cos(rad) * kMinWidthT * 0.5 * v;\r
-                               poly3[1].X = x3 + cos(rad) * kMinWidthT * 0.8 * 0.5 * v + sin(rad) * kMinWidthT * 0.6 * 0.5 * v;\r
-                               poly3[1].Y = y3 + sin(rad) * kMinWidthT * 0.8 * 0.5 * v - cos(rad) * kMinWidthT * 0.6 * 0.5 * v;\r
-                               poly3[2].X = x3 + cos(rad) * kMinWidthT * 0.5 * v;\r
-                               poly3[2].Y = y3 + sin(rad) * kMinWidthT * 0.5 * v;\r
-                               poly3[3].X = x3 + cos(rad) * kMinWidthT * 0.5 * 0.8 * v - sin(rad) * kMinWidthT * 0.6 * 0.5 * v;\r
-                               poly3[3].Y = y3 + sin(rad) * kMinWidthT * 0.5 * 0.8 * v + cos(rad) * kMinWidthT * 0.6 * 0.5 * v;\r
-                               poly3[4].X = x3 - sin(rad) * kMinWidthT * 0.5 * v;\r
-                               poly3[4].Y = y3 + cos(rad) * kMinWidthT * 0.5 * v;\r
-                               icPolygon(poly3, 5);\r
-                       }\r
-               }\r
-               \r
                if(a2 == 9 || (a1 == 7 && a2 == 0)){ // Sinnyu & L2RD Harai\r
                        if(y2 == y3){\r
                                poly2[0].X = x3;\r
-                               poly2[0].Y = y3 + kMinWidthT;\r
+                               poly2[0].Y = y3 + kMinWidthT * kL2RDfatten;\r
                                poly2[1].X = x3;\r
-                               poly2[1].Y = y3 - kMinWidthT;\r
-                               poly2[2].X = x3 + kMinWidthT;\r
-                               poly2[2].Y = y3 - kMinWidthT;\r
+                               poly2[1].Y = y3 - kMinWidthT * kL2RDfatten;\r
+                               poly2[2].X = x3 + kMinWidthT * kL2RDfatten;\r
+                               poly2[2].Y = y3 - kMinWidthT * kL2RDfatten;\r
                                icPolygon(poly2, 3);\r
                        }\r
                        else{\r
-                               poly2[0].X = x3 + kMinWidthT * YX;\r
-                               poly2[0].Y = y3 + kMinWidthT * YY;\r
-                               poly2[1].X = x3 - kMinWidthT * YX;\r
-                               poly2[1].Y = y3 - kMinWidthT * YY;\r
-                               poly2[2].X = x3 + kMinWidthT * XX - kMinWidthT * YX;\r
-                               poly2[2].Y = y3 + kMinWidthT * XY - kMinWidthT * YY;\r
+                               poly2[0].X = x3 + kMinWidthT * kL2RDfatten * YX;\r
+                               poly2[0].Y = y3 + kMinWidthT * kL2RDfatten * YY;\r
+                               poly2[1].X = x3 - kMinWidthT * kL2RDfatten * YX;\r
+                               poly2[1].Y = y3 - kMinWidthT * kL2RDfatten * YY;\r
+                               poly2[2].X = x3 + kMinWidthT * kL2RDfatten * XX - kMinWidthT * kL2RDfatten * YX;\r
+                               poly2[2].Y = y3 + kMinWidthT * kL2RDfatten * XY - kMinWidthT * kL2RDfatten * YY;\r
                                icPolygon(poly2, 3);\r
                        }\r
                }\r