]> granicus.if.org Git - graphviz/commitdiff
consolidate font resolution verbose messages
authorellson <devnull@localhost>
Mon, 17 Jul 2006 18:56:22 +0000 (18:56 +0000)
committerellson <devnull@localhost>
Mon, 17 Jul 2006 18:56:22 +0000 (18:56 +0000)
lib/common/fontmetrics.c
plugin/pango/gvtextlayout_pango.c

index a3514a1e10b831413c9a2ac8b411f25989ddd663..43620bb6acafaed9e8ffab73cea96da7b9df0a20 100644 (file)
@@ -173,7 +173,7 @@ pointf textsize(graph_t *g, textpara_t * para, char *fontname, double fontsize)
 
     if (Verbose) {
        if (emit_once(para->fontname)) {
-           fprintf(stderr, "%s: fontname=%s fontpath=%s\n",
+           fprintf(stderr, "%s: fontname \"%s\" resolved to \"%s\"\n",
                    GD_gvc(g)->common.cmdname, para->fontname, fontpath);
        }
     }
index 4add1ba6f5618ac4d77489f6baca1fa4f967f897..2b09eadb99378e20d3917f2abea2fe6110f3d92e 100644 (file)
@@ -125,24 +125,12 @@ static void pango_textlayout(GVCOMMON_t *common, textpara_t * para, char **fontp
 
         /* try to find a match for a PostScript font
         * - or just get best available match */
-        if (common->verbose)
-           fprintf(stderr, "Font: \"%s\"", fontname);
-
-        if ((fontreq = find_postscript_font(fontname))) {
-            if (common->verbose)
-               fprintf(stderr, " (ps) translated to: \"%s\"", fontreq);
-        }
-        else
+        if (! (fontreq = find_postscript_font(fontname)))
            fontreq = fontname;
         desc = pango_font_description_from_string(fontreq);
-        if (common->verbose) {
-           family = pango_font_description_get_family (desc);
-           if (strcmp(family, fontreq) == 0)
-               fprintf(stderr, " resolved.\n");
-           else
-                fprintf(stderr, " resolved to: \"%s\"\n", family);
-        }
     }
+    family = pango_font_description_get_family (desc);
+    *fontpath = (char *)family;
 
     pango_font_description_set_size (desc, (gint)(para->fontsize * PANGO_SCALE));
 
@@ -170,9 +158,6 @@ static void pango_textlayout(GVCOMMON_t *common, textpara_t * para, char **fontp
        *fontpath = NULL;              /* indicate a problem */
        logical_rect.height = 0;
     }
-    else {
-       *fontpath = "[pango]";
-    }
 
     para->width = (double)logical_rect.width / PANGO_SCALE;
     para->height = (double)logical_rect.height / PANGO_SCALE;