X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_afm.h;h=cedc9949d30a42ae76e54aafee405e1c87651f1b;hp=b4d764350809a7d383171a9ebf569a381d49d8b6;hb=0dc5d6d50c0d95ba4f04b656358b26518d4ce854;hpb=c112f7c06e534ce7a5a4e25b6f7f742aeb051850 diff --git a/src/rrd_afm.h b/src/rrd_afm.h index b4d7643..cedc994 100644 --- a/src/rrd_afm.h +++ b/src/rrd_afm.h @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.2rc3 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.9 Copyright by Tobi Oetiker, 1997-2005 **************************************************************************** * rrd_afm.h Parsing afm tables to find width of strings. ****************************************************************************/ @@ -7,13 +7,29 @@ #ifndef RRD_AFM_H #define RRD_AFM_H +/* + If the font specified by the name parameter in the routes below + is not found + (because it is not compiled into rrd_afm_data.c by compile_afm.pl) + the font specified by RRD_AFM_DEFAULT_FONT will be used. + If it is not installed, it uses the first font compiled + into rrd_afm_data.c + So they will always use some font. +*/ + +#define RRD_AFM_DEFAULT_FONT "Courier" + /* measure width of a text string */ /* fontname can be full name or postscript name */ double afm_get_text_width ( double start, const char* font, double size, double tabwidth, const char* text); +double afm_get_ascender(const char* font, double size); +double afm_get_descender(const char* font, double size); + /* get postscript name from fullname or postscript name */ const char *afm_get_font_postscript_name ( const char* font); +const char *afm_get_font_name(const char* font); /* cc -E -dM /dev/null */ #ifdef __APPLE__