X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_afm.c;h=5bf6e91696b1de68c3a9a518a0ecf25f7f213eac;hb=ee5c354c98d7393c92829a865279e3eb83a3b038;hp=b9996f45a6690390ef41ea3a2119957a997a6d30;hpb=c112f7c06e534ce7a5a4e25b6f7f742aeb051850;p=rrdtool.git diff --git a/src/rrd_afm.c b/src/rrd_afm.c index b9996f4..5bf6e91 100644 --- a/src/rrd_afm.c +++ b/src/rrd_afm.c @@ -1,10 +1,10 @@ /**************************************************************************** - * RRDtool 1.2rc3 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.4 Copyright by Tobi Oetiker, 1997-2005 **************************************************************************** * rrd_afm.h Parsing afm tables to find width of strings. ****************************************************************************/ -#ifdef WIN32 +#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) #include "../confignt/config.h" #else #include "config.h" @@ -73,6 +73,18 @@ const char *afm_get_font_postscript_name(const char* font) return p ? p->postscript_name : "Helvetica"; } +double afm_get_ascender(const char* font, double size) +{ + const afm_fontinfo *p = afm_findfont(font); + return p ? p->ascender : 10; /* just a guess to avoid really bad design if we don't know the font */ +} + +double afm_get_descender(const char* font, double size) +{ + const afm_fontinfo *p = afm_findfont(font); + return p ? p->descender : 4; /* just a guess to avoid really bad design if we don't know the font */ +} + static int afm_find_char_index(const afm_fontinfo *fontinfo, afm_cunicode ch1) {