From: erg Date: Fri, 4 Feb 2005 22:02:26 +0000 (+0000) Subject: Fix for bug 625 - when gd is used without freetype, need to set display X-Git-Tag: LAST_LIBGRAPH~32^2~7951 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ee36946c4bc80ec030d0d086269280a3912c4a7;p=graphviz Fix for bug 625 - when gd is used without freetype, need to set display dpi and make sure 2 call occur after this is set. --- diff --git a/lib/common/input.c b/lib/common/input.c index 2decf1bf6..27225d934 100644 --- a/lib/common/input.c +++ b/lib/common/input.c @@ -415,9 +415,6 @@ graph_t *next_input_graph(void) void graph_init(graph_t * g) { -#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE) - initDPI(g); -#endif /* initialize the graph */ init_ugraph(g); @@ -557,7 +554,6 @@ void init_ugraph(graph_t * g) else if (streq(p, "RL")) GD_rankdir(g) = RANKDIR_RL; } - do_graph_label(g); xf = late_double(g, agfindattr(g, "nodesep"), DEFAULT_NODESEP, MIN_NODESEP); GD_nodesep(g) = POINTS(xf); @@ -603,6 +599,13 @@ void init_ugraph(graph_t * g) || ((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) + if (GD_drawing(g)->dpi < 1.0) GD_drawing(g)->dpi = DEFAULT_DPI; + initDPI(g); +#endif + do_graph_label(g); + Nodesep = 1.0; Nodefactor = 1.0; Initial_dist = MYHUGE;