]> granicus.if.org Git - graphviz/commitdiff
Change test data a3.dot to reflect the bug fix for graph labels and
authorellson <devnull@localhost>
Tue, 18 Oct 2005 19:05:55 +0000 (19:05 +0000)
committerellson <devnull@localhost>
Tue, 18 Oct 2005 19:05:55 +0000 (19:05 +0000)
rankdir=BT;
don't print any config file info with -v if plugins are disabled;
move free of fontpath malloced in libgd to after possible use.

lib/common/fontmetrics.c
lib/common/gdtextsize.c
lib/gvc/gvplugin.c

index 9a3a21681e8239aa697b59579220c15984892668..b43d033b692644ad76bf4b03c11abaebe4d86be1 100644 (file)
@@ -201,6 +201,7 @@ estimate_textsize(textline_t * textline, char *fontname, double fontsz,
 double textwidth(textline_t * textline, char *fontname, double fontsize)
 {
     char *fontpath = NULL;
+    int freeFontpath = 0;
 #ifdef CAIRO_HAS_FT_FONT
     cairo_t *cr;
     cairo_text_extents_t extents;
@@ -217,6 +218,8 @@ double textwidth(textline_t * textline, char *fontname, double fontsize)
 #else
     if (gd_textsize(textline, fontname, fontsize, &fontpath))
        estimate_textsize(textline, fontname, fontsize, &fontpath);
+    else
+       freeFontpath = 1; /* libgd mallocs space for fontpath */
 #endif
 
     if (Verbose) {
@@ -225,5 +228,6 @@ double textwidth(textline_t * textline, char *fontname, double fontsize)
                    fontname, fontpath);
        }
     }
+    if (freeFontpath) free (fontpath);
     return textline->width;
 }
index ad5e032443844231058ac9fa6145db6178492e64..572a77aef6a86260df6d6813cf85aa57cc533dc6 100644 (file)
@@ -125,7 +125,6 @@ char *gd_textsize(textline_t * textline, char *fontname, double fontsz,
        }
 
        *fontpath = strex.fontpath;
-       if (strex.fontpath) free (strex.fontpath);
 
        if (textline->str && textline->str[0]) {
            /* can't use brect on some archtectures if strlen 0 */
index ee0d17c1c78273d4f10d9d39733212725c481f54..34cbfa94e4d92c2f9b4b323e73858b28a3c7bd5f 100644 (file)
@@ -332,11 +332,13 @@ void gvplugin_write_status(GVC_t * gvc)
 {
     int api;
 
+#ifndef DISABLE_LTDL
     fprintf(stderr,"The plugin configuration file:\n\t%s\n", gvc->config_path);
     if (gvc->config_found)
        fprintf(stderr,"\t\twas successfully loaded.\n");
     else
        fprintf(stderr,"\t\twas not found or not usable. No on-demand plugins.\n");
+#endif
 
     for (api = 0; api < ARRAY_SIZE(api_names); api++) {
        fprintf(stderr,"    %s\t: %s\n", api_names[api], gvplugin_list(gvc, api, ":"));