From: ellson Date: Tue, 1 Feb 2005 17:35:48 +0000 (+0000) Subject: store default font name/size in gvc instead of as globals. X-Git-Tag: LAST_LIBGRAPH~32^2~7966 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7ce0b6a873858ad6a540d7b73c1239e9b351f66;p=graphviz store default font name/size in gvc instead of as globals. --- diff --git a/lib/common/emit.c b/lib/common/emit.c index 6b6ad0909..88b269214 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -33,8 +33,6 @@ char *BaseLineStyle[3] = { "solid\0", "setlinewidth\0001\0", 0 }; int Obj; -static double Deffontsize; -static char *Deffontname; static attrsym_t *G_peripheries; static point exch_xy(point p) @@ -407,7 +405,7 @@ static void emit_background(GVC_t * gvc, graph_t *g, boxf pageBox) static void emit_defaults(GVC_t * gvc) { gvrender_set_pencolor(gvc, DEFAULT_COLOR); - gvrender_set_font(gvc, Deffontname, Deffontsize); + gvrender_set_font(gvc, gvc->defaultfontname, gvc->defaultfontsize); } @@ -1009,13 +1007,12 @@ static void init_gvc_from_graph(GVC_t * gvc, graph_t * g) /* rotation */ gvc->rotation = GD_drawing(g)->landscape ? 90 : 0; - /* FIXME - what is this ? */ + /* clusters have peripheries */ G_peripheries = agfindattr(g, "peripheries"); - /* FIXME - why is this ? */ - Deffontname = late_nnstring(g->proto->n, N_fontname, DEFAULT_FONTNAME); - Deffontsize = - late_double(g->proto->n, N_fontsize, DEFAULT_FONTSIZE, + /* default font */ + gvc->defaultfontname = late_nnstring(g->proto->n, N_fontname, DEFAULT_FONTNAME); + gvc->defaultfontsize = late_double(g->proto->n, N_fontsize, DEFAULT_FONTSIZE, MIN_FONTSIZE); gvc->graphname = g->name; diff --git a/lib/gvc/gvcint.h b/lib/gvc/gvcint.h index fb44a99f8..6f2e1778f 100644 --- a/lib/gvc/gvcint.h +++ b/lib/gvc/gvcint.h @@ -176,6 +176,10 @@ extern "C" { int numLayers; /* number of layers */ int layerNum; /* current layer - 1 based*/ + /* default font */ + char *defaultfontname; + double defaultfontsize; + gvstyle_t styles[MAXNEST]; /* style stack - reused by each job */ int SP;