From 8f3fa6416807e19eac1dc08ad02a2bdc6c8ef7d6 Mon Sep 17 00:00:00 2001 From: Koichi KAMICHI Date: Thu, 28 Oct 2004 06:26:31 +0000 Subject: [PATCH] Fix exporting SVG format. Changed some file's path (as temp.) --- kagecgi/Makefile | 2 +- kagecgi/kagecgi.c | 5 +++-- kagecgi/kagecgi.h | 6 ++++-- kagecgi/kageic.c | 59 ++++++++++++++++++++++++++++------------------------- 4 files changed, 39 insertions(+), 33 deletions(-) diff --git a/kagecgi/Makefile b/kagecgi/Makefile index 5181c8a..1c886a4 100755 --- a/kagecgi/Makefile +++ b/kagecgi/Makefile @@ -9,7 +9,7 @@ SHAREDIR=/usr/local/share/kagecgi DBURL=http://fonts.jp/kagedb/kagedb CFLAGS= -LIBS= -lpng -ldb +LIBS= -lpng -ldb -lm #for MacOSX with fink #CFLAGS= -I/sw/include -I/sw/include/db3 -I/sw/include/libpng/ diff --git a/kagecgi/kagecgi.c b/kagecgi/kagecgi.c index 24fb599..bfd494a 100755 --- a/kagecgi/kagecgi.c +++ b/kagecgi/kagecgi.c @@ -99,7 +99,8 @@ int main(int argc, char *argv[]){ if(kType == 1){ //svg kg_string_append(kResultText, "\n"); kg_string_append(kResultText, "\n"); - kg_string_append(kResultText, ""); + kg_string_append(kResultText, ""); + kg_string_append(kResultText, ""); } else if(kType == 2){ //eps kg_string_append(kResultText, "%!PS-Adobe-3.0 EPSF-3.0\n"); @@ -162,7 +163,7 @@ int main(int argc, char *argv[]){ test2 = CalcSizes(test2, 1); kMode = 1; drawGlyph(test2, 0); - kg_string_append(kResultText, "\n"); + kg_string_append(kResultText, "\n"); if(type != 1) fprintf(stdout, "Content-type: image/svg-xml\n\n"); fprintf(stdout, "%s", kResultText->str); } diff --git a/kagecgi/kagecgi.h b/kagecgi/kagecgi.h index cd38a5a..4ce9d49 100755 --- a/kagecgi/kagecgi.h +++ b/kagecgi/kagecgi.h @@ -9,9 +9,11 @@ // define for localhost environment #define errorFileSize 3992 -#define errorFileName "/usr/local/share/kagecgi/error.png" +//#define errorFileName "/usr/local/share/kagecgi/error.png" +#define errorFileName "error.png" #define pngFilePath "/var/www/fontsjp/v0.4/" -#define databaseFileName "/usr/local/share/kagecgi/kagedb" +//#define databaseFileName "/usr/local/share/kagecgi/kagedb" +#define databaseFileName "kagedb" #define kBaseline 188 #define pngWidth 200 diff --git a/kagecgi/kageic.c b/kagecgi/kageic.c index ad67f0a..3edbe2f 100755 --- a/kagecgi/kageic.c +++ b/kagecgi/kageic.c @@ -5,32 +5,35 @@ #include "kagecgi.h" void icPolygon(kPoint *poly, int number){ - int i; - char buf[256]; - - if(kMode == 0){ //normal - fillPolygon(poly, number, 0, kageCanvas); - } - else if(kMode == 1){ //output for svg - sprintf(buf, ""); - kg_string_append(kResultText, buf); - } - else if(kMode == 2){ //output for eps - sprintf(buf, "%.0f %.0f moveto\n", poly[0].X * 5, 1000 - (poly[0].Y * 5) - 200); - kg_string_append(kResultText, buf); - for(i = 1; i < number; i++){ - sprintf(buf, " %.0f %.0f lineto\n", poly[i].X * 5, 1000 - (poly[i].Y * 5) - 200); - kg_string_append(kResultText, buf); - } - sprintf(buf, " %.0f %.0f lineto\n", poly[0].X * 5, 1000 - (poly[0].Y * 5) - 200); - kg_string_append(kResultText, buf); - kg_string_append(kResultText, "closepath\n"); - } - + int i; + char buf[256]; + + if(kMode == 0){ //normal + fillPolygon(poly, number, 0, kageCanvas); + } + else if(kMode == 1){ //output for svg + sprintf(buf, ""); + kg_string_append(kResultText, buf); + } + else if(kMode == 2){ //output for eps + sprintf(buf, "%.0f %.0f moveto\n", poly[0].X * 5, 1000 - (poly[0].Y * 5) - 200); + kg_string_append(kResultText, buf); + for(i = 1; i < number; i++){ + sprintf(buf, " %.0f %.0f lineto\n", poly[i].X * 5, 1000 - (poly[i].Y * 5) - 200); + kg_string_append(kResultText, buf); + } + sprintf(buf, " %.0f %.0f lineto\n", poly[0].X * 5, 1000 - (poly[0].Y * 5) - 200); + kg_string_append(kResultText, buf); + kg_string_append(kResultText, "closepath\n"); + } } -- 1.7.10.4