]> granicus.if.org Git - graphviz/commitdiff
Fix core dump when using -v and no font is found.
authorerg <devnull@localhost>
Fri, 21 Jan 2011 19:43:29 +0000 (19:43 +0000)
committererg <devnull@localhost>
Fri, 21 Jan 2011 19:43:29 +0000 (19:43 +0000)
lib/common/fontmetrics.c

index 30988b32de3e63cf2533afe59cb01523f3d4ad63..d3b2490ffb3caf8c751cc9d018f81cecbbbc87cf 100644 (file)
@@ -206,9 +206,13 @@ pointf textsize(graph_t *g, textpara_t * para, char *fontname, double fontsize)
     if (! gvtextlayout(GD_gvc(g), para, fp))
        estimate_textlayout(g, para, fp);
 
-    if (fp)
-       fprintf(stderr, "fontname: \"%s\" resolved to: %s\n",
+    if (fp) {
+       if (fontpath)
+           fprintf(stderr, "fontname: \"%s\" resolved to: %s\n",
                    para->fontname, fontpath);
+       else
+           fprintf(stderr, "fontname: unable to resolve \"%s\"\n", para->fontname);
+    }
 
     size.x = para->width;
     size.y = para->height;