From: oetiker Date: Sat, 30 Apr 2005 09:38:50 +0000 (+0000) Subject: let rrd_graph honor the font name (RRD_DEFAULT_FONT) defined in confignt/config.h X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=61d2c5d335a07bc1e558b6eb1593ca04ec0c963f;p=rrdtool.git let rrd_graph honor the font name (RRD_DEFAULT_FONT) defined in confignt/config.h git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@451 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/confignt/config.h b/confignt/config.h index 62ebc54..3a7336b 100644 --- a/confignt/config.h +++ b/confignt/config.h @@ -14,15 +14,13 @@ #define rrd_realloc(a,b) realloc((a), (b)) #define snprintf _snprintf -/* Code in rrd_graph.c:rrd_graph_init() uses the %windir% - * environment variable to override this. This should - * avoid the recompile problem if the system directory is - * c:/windows vs. d:/winnt. - * This #define can't be removed because: - * (1) the constant is used outside of rrd_graph_init() to init a struct - * (2) windir might not be available in all environments + +/* Code in rrd_graph.c:rrd_graph_init() uses the %windir% environment + * variable to find the actual location of this relative font path to avoid + * the recompile problem if the system directory is c:/windows vs. d:/winnt. */ -#define RRD_DEFAULT_FONT "c:/windows/fonts/cour.ttf" + +#define RRD_DEFAULT_FONT "cour.ttf" #define RRDGRAPH_YLEGEND_ANGLE 90.0 diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 910f9db..dc21548 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -2797,7 +2797,8 @@ rrd_graph_init(image_desc_t *im) if (windir != NULL) { strncpy(rrd_win_default_font,windir,999); rrd_win_default_font[999] = '\0'; - strcat(rrd_win_default_font,"\\fonts\\cour.ttf"); + strcat(rrd_win_default_font,"\\fonts\\"); + strcat(rrd_win_default_font,RRD_DEFAULT_FONT); for(i=0;i