]> granicus.if.org Git - graphviz/commitdiff
Make libgd optional, default without.
authorellson <devnull@localhost>
Sun, 21 May 2006 06:33:20 +0000 (06:33 +0000)
committerellson <devnull@localhost>
Sun, 21 May 2006 06:33:20 +0000 (06:33 +0000)
Use:  --with-mylibgd to add it back in
or use: graphviz-gd  to get it from a plugin.

18 files changed:
lib/common/Makefile.am
lib/common/diagen.c
lib/common/fontmetrics.c
lib/common/hpglgen.c
lib/common/htmllex.c
lib/common/htmltable.c
lib/common/input.c
lib/common/labels.c
lib/common/picgen.c
lib/common/psgen.c
lib/common/render.h
lib/common/types.h
lib/common/utils.c
lib/common/utils.h
lib/common/xdgen.c
lib/gvc/gvconfig.c
lib/gvc/gvusershape.c
lib/neatogen/adjust.c

index 78abfdaacc333e46fe0139edd4bf8fbf7865330b..52cc72ea2d38f016e71ad00e6bf4feacf88d7cf4 100644 (file)
@@ -17,8 +17,13 @@ noinst_HEADERS = render.h utils.h memory.h \
 noinst_LTLIBRARIES = libcommon.la
 
 if !DISABLE_CODEGENS
+if WITH_LIBGD
 CODEGENS = diagen.c figgen.c hpglgen.c gdgen.c mapgen.c mifgen.c mpgen.c \
        picgen.c psgen.c svggen.c vrmlgen.c vtxgen.c ps.txt xdgen.c color_names
+else
+CODEGENS = diagen.c figgen.c hpglgen.c mapgen.c mifgen.c mpgen.c \
+       picgen.c psgen.c svggen.c vtxgen.c ps.txt xdgen.c color_names
+endif
 endif
 
 
index deea14295128b58c737df2cb1d6a050bbce8acd4..8e81d46e70ad16cdd931cb80fe7bd910c07a7aec 100644 (file)
@@ -533,8 +533,8 @@ static void dia_textline(point p, textline_t * line)
     dia_fputs("      </dia:attribute>\n");
     dia_fputs("      <dia:attribute name=\"obj_bb\">\n");
     dia_printf("        <dia:rectangle val=\"%g,%g;%g,%g\"/>\n",
-              mp.x - (Scale * (line->width) / 2.), mp.y - 0.4,
-              mp.x + (Scale * (line->width) / 2.), mp.y + 0.4);
+              mp.x - (Scale * (line->dimen.x) / 2.), mp.y - 0.4,
+              mp.x + (Scale * (line->dimen.x) / 2.), mp.y + 0.4);
     dia_fputs("      </dia:attribute>\n");
     dia_fputs("    </dia:object>\n");
 }
index c94dd88528a04d1f44630db07bca68526ec37dfe..57df6a49ed572be836d49cd346fada5f8c9264a4 100644 (file)
@@ -119,63 +119,36 @@ static double courFontWidth[] = {
     0.5999, 0.5999, 0.5999, 0.5999, 0.5999, 0.5999, 0.5999, 0.5999,    /* øùúû     */
 };
 
-#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
-extern codegen_t *Output_codegen;
-
-double _dpi;
-void initDPI(graph_t * g)
-{
-    _dpi = GD_drawing(g)->dpi;
-fprintf(stderr,"graph dpi = %g\n", _dpi);
-}
-
-extern codegen_t GD_CodeGen;
-
-double textheight(int nlines, double fontsz)
-{
-    if (Output_codegen == &GD_CodeGen) {
-       double fsize = (fontsz * _dpi) / POINTS_PER_INCH;       /* in pixels */
-       double fontsize = builtinFontHt(fsize);
-       return (nlines * (int) (fontsize * LINESPACING) *
-               POINTS_PER_INCH) / _dpi;
-    } else
-       return nlines * (int) (fontsz * LINESPACING);
-}
-#endif
-
 /* estimate_textsize:
- * Estimate width of text, for given face and size, in points.
- * Value is stored textline->width.
+ * Estimate width and height of text, for given face and size, in points.
+ * Value is stored textline->size.
  * NOTE: Tables are based on a font of size 1. Need to multiply by
  * fontsize to get appropriate value.
  */
 static void
-estimate_textsize(textline_t * textline, char *fontname, double fontsz,
-                 char **fontpath)
+estimate_textsize(graph_t *g, textline_t * textline, char *fontname, double fontsz, char **fontpath)
 {
     double *Fontwidth;
     char c, *p;
 
-    textline->width = 0.0;
-    textline->height = fontsz;
+    textline->dimen.x = 0.0;
+    textline->dimen.y = fontsz;
     textline->xshow = NULL;
     textline->layout = NULL;
     textline->free_layout = NULL;
 
-#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
+#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE) && defined(HAVE_LIBGD)
     if (Output_codegen == &GD_CodeGen) {
-       int cwidth;
-       double fsize = (fontsz * _dpi) / POINTS_PER_INCH;       /* in pixels */
+       double scale = GD_drawing(g)->dpi) / POINTS_PER_INCH;
+       double fsize = fontsz * scale;  /* in pixels */
        *fontpath = "[internal gd]";
-       cwidth = builtinFontWd(fsize);
-       if ((p = textline->str)) {
-           textline->width = strlen(p) * cwidth * POINTS_PER_INCH / _dpi;
-       }
+       if ((p = textline->str))
+           textline->dimen.x = strlen(p) * builtinFontWd(fsize) / scale;
+       textline->dimen.y = builtinFontHt(fsize) / scale;
        return;
-    } else if (!strncasecmp(fontname, "cour", 4)) {
-#else
-    if (!strncasecmp(fontname, "cour", 4)) {
+    }
 #endif
+    if (!strncasecmp(fontname, "cour", 4)) {
        *fontpath = "[internal courier]";
        Fontwidth = courFontWidth;
     } else if (!strncasecmp(fontname, "arial", 5)
@@ -188,17 +161,17 @@ estimate_textsize(textline_t * textline, char *fontname, double fontsz,
     }
     if ((p = textline->str)) {
        while ((c = *p++))
-           textline->width += Fontwidth[(unsigned char) c];
-       textline->width *= fontsz;
+           textline->dimen.x += Fontwidth[(unsigned char) c];
+       textline->dimen.x *= fontsz;
     }
 }
 
-double textwidth(graph_t *g, textline_t * textline, char *fontname, double fontsize)
+pointf textsize(graph_t *g, textline_t * textline, char *fontname, double fontsize)
 {
     char *fontpath = NULL;
 
     if (! gvtextlayout(GD_gvc(g), textline, fontname, fontsize, &fontpath))
-       estimate_textsize(textline, fontname, fontsize, &fontpath);
+       estimate_textsize(g, textline, fontname, fontsize, &fontpath);
 
     if (Verbose) {
        if (emit_once(fontname)) {
@@ -206,5 +179,5 @@ double textwidth(graph_t *g, textline_t * textline, char *fontname, double fonts
                    fontname, fontpath);
        }
     }
-    return textline->width;
+    return textline->dimen;
 }
index c6e413b80c78687699c455b7f34f1a1e20311440..19372981206feac35e6c01c8848e23c6dae1a909 100644 (file)
@@ -647,11 +647,11 @@ static void hpgl_textline(point p, textline_t * line)
     case 'l':
        break;
     case 'r':
-       p.x -= line->width;
+       p.x -= line->dimen.x;
        break;
     default:
     case 'n':
-       p.x -= line->width / 2;
+       p.x -= line->dimen.x / 2;
        break;
     }
 
index a43d6dd71d1595415a30d9da58c2dcf2689edf7c..e9f5dd0ea96d884c30451862e06d55300878e2a7 100644 (file)
@@ -19,7 +19,6 @@
 #include "htmltable.h"
 #include "htmlparse.h"
 #include "htmllex.h"
-#include "entities.h"
 #include <ctype.h>
 
 #ifdef HAVE_LIBEXPAT
@@ -663,44 +662,6 @@ static char *eatComment(char *p)
     return s;
 }
 
-#define MAXENTLEN 8
-
-static int 
-comp_entities(const void *e1, const void *e2) {
-  struct entities_s *en1 = (struct entities_s *) e1;
-  struct entities_s *en2 = (struct entities_s *) e2;
-  return strcmp(en1->name, en2->name);
-}
-
-/* scanEntity:
- * Scan non-numeric entity, convert to &#...; form and store in xbuf.
- * t points to first char after '&'. Return after final semicolon.
- * If unknown, we return t and let libexpat flag the error.
- */
-static char*
-scanEntity (char* t, agxbuf* xb)
-{
-    char*  endp = strchr (t, ';');
-    struct entities_s key, *res;
-    int    len;
-    char   buf[MAXENTLEN+1];
-
-    agxbputc(xb, '&');
-    if (!endp) return t;
-    if (((len = endp-t) > MAXENTLEN) || (len < 2)) return t;
-    strncpy (buf, t, len);
-    buf[len] = '\0';
-    key.name =  buf;
-    res = bsearch(&key, entities, NR_OF_ENTITIES,
-       sizeof(entities[0]), comp_entities);
-    if (!res) return t;
-    sprintf (buf, "%d", res->value);
-    agxbputc(xb, '#');
-    agxbput(xb, buf);
-    agxbputc(xb, ';');
-    return (endp+1); 
-}
-
 /* findNext:
  * Return next XML unit. This is either <..>, an HTML 
  * comment <!-- ... -->, or characters up to next <.
index e2eabc86f968ff288c7808e7cc2f439f390bf39d..0d35a7117f8a9d76925b05869eb3aa93145b0e06 100644 (file)
@@ -202,7 +202,8 @@ emit_htextlines(GVJ_t* job, int nlines, htextline_t* lines, pointf p,
            tl.str = ti->str;
            tl.xshow = ti->xshow;
            tl.layout = ti->layout;
-           tl.width = lines[i].size;
+           tl.dimen.x = lines[i].size;
+           tl.dimen.y = lines[i].lfsize;
            tl.just = lines[i].just;
 
            gvrender_textline(job, p_, &tl);
@@ -708,10 +709,10 @@ size_html_txt(graph_t *g, htmltxt_t * txt, htmlenv_t * env)
 {
     double xsize = 0.0;
     double fsize;
-    int width;
     char *fname;
     char *news = NULL;
     textline_t *lp = txt->line;
+    pointf size;
 
     if (txt->font) {
        if (txt->font->size > 0.0)
@@ -743,17 +744,17 @@ size_html_txt(graph_t *g, htmltxt_t * txt, htmlenv_t * env)
        free(lp->str);
        lp->str = news;
 
-       width = textwidth(g, lp, fname, fsize);
+       size = textsize(g, lp, fname, fsize);
        /* no margins are added since the containing node or cell will pad */
-       if (width > xsize)
-           xsize = width;
+       if (dimen.x > xsize)
+           xsize = size.x;
        lp++;
     }
     txt->box.UR.x = xsize;
     if (txt->nlines == 1)
-       txt->box.UR.y = (int) (fsize);
+       txt->box.UR.y = (int) (size.y);
     else
-       txt->box.UR.y = txt->nlines * (int) (fsize * LINESPACING);
+       txt->box.UR.y = txt->nlines * (int) (size.y * LINESPACING);
     return 0;
 }
 #endif
@@ -781,6 +782,7 @@ size_html_txt(graph_t *g, htmltxt_t* ftxt, htmlenv_t* env)
 {
     double xsize = 0.0, ysize = 0.0;
     double fsize, lsize = 0.0;
+    pointf sz;
     int i, j, w = 0, width = 0;
     char *fname;
     textline_t lp;
@@ -816,10 +818,11 @@ size_html_txt(graph_t *g, htmltxt_t* ftxt, htmlenv_t* env)
                fsize = env->finfo.size;
                fname = env->finfo.name;
            }
-           w = textwidth(g, &lp, fname, fsize);
+           sz = textsize(g, &lp, fname, fsize);
+           w = sz.x;
            free (ftxt->lines[i].items[j].str);
            ftxt->lines[i].items[j].str = lp.str;
-           ftxt->lines[i].items[j].size = (double) w;
+           ftxt->lines[i].items[j].size = sz.x;
            ftxt->lines[i].items[j].xshow = lp.xshow;
            ftxt->lines[i].items[j].layout = lp.layout;
            ftxt->lines[i].items[j].free_layout = lp.free_layout;
index 6e2506eccdf182e20147c178e442a8dec9feb5ba..0e24360f19909ae6885c14998d5c09ed0645b731 100644 (file)
@@ -561,11 +561,8 @@ void graph_init(graph_t * g, bool use_rankdir)
        || ((p = agget(g, "resolution")) && p[0]))
        GD_drawing(g)->dpi = atof(p);
 
-    /* The following two functions rely on dpi being set */
-#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
+    /* The following functions relies on dpi being set */
     if (GD_drawing(g)->dpi < 1.0) GD_drawing(g)->dpi = DEFAULT_DPI;
-    initDPI(g);
-#endif
     do_graph_label(g);
 
     Initial_dist = MYHUGE;
index 0ed8e7140b3431b777481eecb9c026e036085c83..bf80b99a7266905c6bbcd5badddd81636221b807 100644 (file)
 #include "htmltable.h"
 #include <limits.h>
 
-#ifndef DISABLE_CODEGENS
-extern codegen_t *Output_codegen;
-extern codegen_t *GD_CodeGen;
-#endif
-
 static void storeline(graph_t *g, textlabel_t *lp, char *line, char terminator)
 {
-    double width = 0.0;
+    pointf size;
 
     lp->u.txt.line =
        ALLOC(lp->u.txt.nlines + 2, lp->u.txt.line, textline_t);
     lp->u.txt.line[lp->u.txt.nlines].str = line;
-    width = textwidth(g, &(lp->u.txt.line[lp->u.txt.nlines]),
+    size = textsize(g, &(lp->u.txt.line[lp->u.txt.nlines]),
            lp->fontname, lp->fontsize);
     lp->u.txt.line[lp->u.txt.nlines].just = terminator;
     lp->u.txt.nlines++;
     /* total width = max line width */
-    if (lp->dimen.x < width)
-       lp->dimen.x = width;
+    if (lp->dimen.x < size.x)
+       lp->dimen.x = size.x;
     /* recalculate total height */
-#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
-    if (Output_codegen == &GD_CodeGen)
-       lp->dimen.y = textheight(lp->u.txt.nlines, lp->fontsize);
-    else
-       lp->dimen.y =
-           lp->u.txt.nlines * (int) (lp->fontsize * LINESPACING);
-#else
-    lp->dimen.y = lp->u.txt.nlines * (int) (lp->fontsize * LINESPACING);
-#endif
-
+    lp->dimen.y = lp->u.txt.nlines * (int) (size.y * LINESPACING);
 }
 
 /* compiles <str> into a label <lp> and returns its bounding box size.  */
index b33ff3e804d0633842e60a9539e9bac43e743129..0cf398cae494c9b056d5869c2cd397cc17ee66ea 100644 (file)
@@ -418,11 +418,11 @@ static void pic_textline(point p, textline_t * line)
        p.x = p.x;
        break;
     case 'r':
-       p.x = p.x - line->width;
+       p.x = p.x - line->dimen.x;
        break;
     default:
     case 'n':
-       p.x = p.x - line->width / 2;
+       p.x = p.x - line->dimen.x / 2;
        break;
     }
     pf = cvt2ptf(p);
@@ -432,7 +432,7 @@ static void pic_textline(point p, textline_t * line)
 #endif
     /* Why on earth would we do this either. But it works. SCN 2/26/2002 */
     pf.y += fontsz / (3.0 * POINTS_PER_INCH);
-    pf.x += line->width / (2.0 * POINTS_PER_INCH);
+    pf.x += line->dimen.x / (2.0 * POINTS_PER_INCH);
     if (!(S[SP].size)) {       /* size was never set in this or hierarchically higher context */
        pic_set_font(S[SP].font, fontsz);       /* primarily to output font and/or size directives */
        for (flag = SP; ((S[flag].size = fontsz), flag); flag--)        /* set size in contexts */
index ca6d9df2b75be351df70ea3980261d3fc4ff6c60..c523d24641b26dceedd4c08e537212bd30a41efc 100644 (file)
@@ -373,11 +373,11 @@ static void ps_textline(point p, textline_t * line)
        case 'l':
            break;
        case 'r':
-           p.x -= line->width;
+           p.x -= line->dimen.x;
            break;
        default:
        case 'n':
-           p.x -= line->width / 2;
+           p.x -= line->dimen.x / 2;
            break;
        }
        fprintf(Output_file, "%d %d moveto\n%s\n[%s]\nxshow\n",
@@ -396,7 +396,7 @@ static void ps_textline(point p, textline_t * line)
            break;
        }
        fprintf(Output_file, "%d %d moveto %.1f %.1f %s alignedtext\n",
-               p.x, p.y, line->width, adj, ps_string(line->str,isLatin1));
+               p.x, p.y, line->dimen.x, adj, ps_string(line->str,isLatin1));
     }
 }
 
@@ -490,6 +490,7 @@ static void ps_polyline(point * A, int n)
     fprintf(Output_file, Stroke);
 }
 
+#ifdef HAVE_LIBGD
 static void writePSBitmap (gdImagePtr im, point p, point sz)
 {
     int x, y, px;
@@ -533,10 +534,20 @@ static void writePSBitmap (gdImagePtr im, point p, point sz)
     fprintf(Output_file, "grestore\n");
 
 }
+#endif
 
 static void ps_freeimage_gd (void *data)
 {
+#ifdef HAVE_LIBGD
     gdImageDestroy((gdImagePtr)data);
+#endif
+}
+
+static void ps_freeimage_ps (void *data)
+{
+#if 0
+    free (data);
+#endif
 }
 
 /* ps_usershape:
@@ -551,7 +562,9 @@ static void ps_freeimage_gd (void *data)
 static void ps_usershape(usershape_t *us, boxf b, point *A, int n, bool filled)
 {
     int j;
+#ifdef HAVE_LIBGD
     gdImagePtr gd_img = NULL;
+#endif
     ps_image_t *ps_img = NULL;
     point offset;
 
@@ -581,21 +594,30 @@ static void ps_usershape(usershape_t *us, boxf b, point *A, int n, bool filled)
     }
 
     if (us->data) {
-       if (us->datafree == ps_freeimage_gd)
+       if (us->datafree == ps_freeimage_gd) {
+#ifdef HAVE_LIBGD
            gd_img = (gdImagePtr)(us->data);  /* use cached data */
+#endif
+       }
+       else if (us->datafree == ps_freeimage_ps) {
 #if 0
-       else if (us->datafree == ps_freeimage_ps)
            ps_img = (ps_image_t *)(us->data);  /* use cached data */
 #endif
+       }
        else {
            us->datafree(us->data);        /* free incompatible cache data */
            us->data = NULL;
        }
     }
 
-    if (!gd_img && !ps_img) { /* read file into cache */
+#ifdef HAVE_LIBGD
+    if (!ps_img && !gd_img) { /* read file into cache */
+#else
+    if (!ps_img) { /* read file into cache */
+#endif
         fseek(us->f, 0, SEEK_SET);
         switch (us->type) {
+#ifdef HAVE_LIBGD
 #ifdef HAVE_GD_PNG
             case FT_PNG:
                 gd_img = gdImageCreateFromPng(us->f);
@@ -610,6 +632,7 @@ static void ps_usershape(usershape_t *us, boxf b, point *A, int n, bool filled)
             case FT_JPEG:
                 gd_img = gdImageCreateFromJpeg(us->f);
                 break;
+#endif
 #endif
            case FT_PS:
            case FT_EPS:
@@ -618,10 +641,12 @@ static void ps_usershape(usershape_t *us, boxf b, point *A, int n, bool filled)
             default:
                break;
         }
+#ifdef HAVE_LIBGD
         if (gd_img) {
             us->data = (void*)gd_img;
             us->datafree = ps_freeimage_gd;
         }
+#endif
 #if 0
         if (ps_img) {
             us->data = (void*)ps_img;
@@ -645,6 +670,7 @@ static void ps_usershape(usershape_t *us, boxf b, point *A, int n, bool filled)
        return;
     }
 
+#ifdef HAVE_LIBGD
     if (gd_img) {
        point sz;
        sz.x = A[0].x - A[2].x;
@@ -652,6 +678,7 @@ static void ps_usershape(usershape_t *us, boxf b, point *A, int n, bool filled)
        writePSBitmap (gd_img, A[2], sz);
        return;
     }
+#endif
 
     /* some other type of image */
     agerr(AGERR, "usershape %s is not supported  in PostScript output\n", us->name);
index f858f99ee201b2c63be4b178fda56c2b160a250f..88c1bdd3848793970bfdb1eb9decb6527ef64f1c 100644 (file)
@@ -49,7 +49,8 @@ extern "C" {
 #include "colorprocs.h"                /* must collow color.h (in types.h) */
 #include "geomprocs.h"         /* must follow geom.h (in types.h) */
 #include "graph.h"             /* must follow types.h */
-#include "utils.h"             /* must follow types.h */
+#include "agxbuf.h"
+#include "utils.h"             /* must follow types.h and agxbuf.h */
 #include "gvplugin.h"          /* must follow gvcext.h (in types.h) */
 #include "gvcint.h"            /* must follow gvcext.h (in types.h) */
 #include "gvcproc.h"           /* must follow gvcext.h (in types.h) */
@@ -157,7 +158,7 @@ extern "C" {
     extern void shape_clip(node_t * n, point curve[4]);
     extern void size_label (graph_t* g, textlabel_t* rv);
     extern void start_timer(void);
-    extern double textwidth(graph_t *g, textline_t * textline,
+    extern pointf textsize(graph_t *g, textline_t * textline,
                            char *fontname, double fontsz);
     extern void translate_bb(Agraph_t *, int);
     extern void use_library(char *);
index 9f62419669b057a35d1943dcc72c3b8074e99d1e..235abf394137494632e476e1f85516f823208b7a 100644 (file)
@@ -128,10 +128,10 @@ extern "C" {
     typedef struct textline_t {
        char *str;      /* stored in utf-8 */
        char *xshow;
-       double width, height;
-       char just;
        void *layout;
        void (*free_layout) (void *layout);   /* FIXME - this is ugly */
+       pointf dimen;
+       char just;
     } textline_t;
 
     typedef struct textlabel_t {
index a6f7c6334b66bdbdccc973da7fbc3e3543d4dd3d..605674e6ad451e0195cf55099f5e31a22ab0b6ed 100644 (file)
@@ -17,6 +17,7 @@
 #include "render.h"
 #include "agxbuf.h"
 #include "htmltable.h"
+#include "entities.h"
 
 #ifndef MSWIN32
 #include <unistd.h>
@@ -1240,14 +1241,43 @@ safe_dcl(graph_t * g, void *obj, char *name, char *def,
     return a;
 }
 
-#include "entities.h"
-
 static int comp_entities(const void *e1, const void *e2) {
   struct entities_s *en1 = (struct entities_s *) e1;
   struct entities_s *en2 = (struct entities_s *) e2;
   return strcmp(en1->name, en2->name);
 }
 
+#define MAXENTLEN 8
+
+/* scanEntity:
+ *  * Scan non-numeric entity, convert to &#...; form and store in xbuf.
+ *   * t points to first char after '&'. Return after final semicolon.
+ *    * If unknown, we return t and let libexpat flag the error.
+ *     */
+char* scanEntity (char* t, agxbuf* xb)
+{
+    char*  endp = strchr (t, ';');
+    struct entities_s key, *res;
+    int    len;
+    char   buf[MAXENTLEN+1];
+
+    agxbputc(xb, '&');
+    if (!endp) return t;
+    if (((len = endp-t) > MAXENTLEN) || (len < 2)) return t;
+    strncpy (buf, t, len);
+    buf[len] = '\0';
+    key.name =  buf;
+    res = bsearch(&key, entities, NR_OF_ENTITIES,
+        sizeof(entities[0]), comp_entities);
+    if (!res) return t;
+    sprintf (buf, "%d", res->value);
+    agxbputc(xb, '#');
+    agxbput(xb, buf);
+    agxbputc(xb, ';');
+    return (endp+1);
+}
+
+
 /* htmlEntity:
  * Check for an HTML entity for a special character.
  * Assume *s points to first byte after '&'. 
index e4e14a4d2632705d845c1579e6cb7a69128eb6ac..239c6c73b2d61616831fc4ca5e4d55457b781958 100644 (file)
@@ -68,6 +68,7 @@ extern "C" {
 
     extern char *latin1ToUTF8(char *);
     extern char* utf8ToLatin1 (char* ins);
+    extern char* scanEntity (char* t, agxbuf* xb);
 
     extern pointf Bezier(pointf *, int, double, pointf *, pointf *);
     extern point dotneato_closest(splines * spl, point p);
index 8093631322271618ede57b38510dbb47c17032f3..345bbaa0933448da7066a366235ef45a7a28783b 100644 (file)
@@ -199,7 +199,7 @@ static void xd_textline(point p, textline_t * line)
        j = 0;
        break;
     }
-    sprintf(buf, "T %d %d %d %d ", p.x, YDIR(p.y), j, (int) line->width);
+    sprintf(buf, "T %d %d %d %d ", p.x, YDIR(p.y), j, (int) line->dimen.x);
     agxbput(xbufs[gvc->emit_state], buf);
     xd_str ("", line->str);
 }
index f813ade02b16d940d0a2ec954c1f7dd4214b46a0..df8ebabb190269cff60179d32c3411ef66583082 100644 (file)
 #endif
     extern codegen_t FIG_CodeGen, HPGL_CodeGen, MAP_CodeGen,
         MIF_CodeGen, XDot_CodeGen, MP_CodeGen, PIC_CodeGen,
-        PS_CodeGen, DIA_CodeGen, SVG_CodeGen, VRML_CodeGen,
-        VTX_CodeGen, GD_CodeGen, memGD_CodeGen;
+        PS_CodeGen, DIA_CodeGen, SVG_CodeGen, VTX_CodeGen;
+#ifdef HAVE_LIBGD
+    extern codegen_t GD_CodeGen, memGD_CodeGen, VRML_CodeGens;
+#endif
 #endif
 
 /*
@@ -366,6 +368,7 @@ static codegen_info_t cg[MAX_CODEGENS] = {
     {&MIF_CodeGen, "mif", MIF},
     {&PIC_CodeGen, "pic", PIC_format},
 
+#ifdef HAVE_LIBGD
     {&GD_CodeGen, "gd", GD},
 #ifdef HAVE_LIBZ
     {&GD_CodeGen, "gd2", GD2},
@@ -386,6 +389,7 @@ static codegen_info_t cg[MAX_CODEGENS] = {
     {&GD_CodeGen, "xbm", XBM},
     {&GD_CodeGen, "xpm", XBM},
 #endif
+#endif
 
 #ifdef QUARTZ_RENDER
     {&QPDF_CodeGen, "pdf", QPDF},
index c7cc5cb7f3b6716359a11df023f58ddf76f14756..4d9861f5a3890b4d9fdeba6c0f8f242fd9b7e6fa 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "types.h"
 #include "graph.h"
+#include "agxbuf.h"
 #include "utils.h"
 
 static Dict_t *ImageDict;
index dac89109982341e1177c8c95f628a37a47f7dc5b..6b84afa4324d82b3400202e63614f788871b31e6 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include "neato.h"
+#include "agxbuf.h"
 #include "utils.h"
 #include "voronoi.h"
 #include "info.h"