From cf14c4c0a998018a09230045b0e8b0792a500c2a Mon Sep 17 00:00:00 2001 From: oetiker Date: Sat, 30 Apr 2005 09:38:50 +0000 Subject: [PATCH] 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@451 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/confignt/config.h | 14 ++++++-------- program/src/rrd_graph.c | 3 ++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/program/confignt/config.h b/program/confignt/config.h index 62ebc546..3a7336b0 100644 --- a/program/confignt/config.h +++ b/program/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/program/src/rrd_graph.c b/program/src/rrd_graph.c index 910f9dbf..dc21548d 100644 --- a/program/src/rrd_graph.c +++ b/program/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