1 /****************************************************************************
2 * RRDtool 1.2.23 Copyright by Tobi Oetiker, 1997-2007
3 ****************************************************************************
4 * rrd_afm.h Parsing afm tables to find width of strings.
5 ****************************************************************************/
13 #define afm_char wchar_t
15 #define afm_char unsigned char
18 If the font specified by the name parameter in the routes below
20 (because it is not compiled into rrd_afm_data.c by compile_afm.pl)
21 the font specified by RRD_AFM_DEFAULT_FONT will be used.
22 If it is not installed, it uses the first font compiled
24 So they will always use some font.
27 #define RRD_AFM_DEFAULT_FONT "Courier"
29 /* measure width of a text string */
30 /* fontname can be full name or postscript name */
31 double afm_get_text_width(
37 double afm_get_text_width_wide(
42 const afm_char * text);
44 double afm_get_ascender(
47 double afm_get_descender(
51 /* get postscript name from fullname or postscript name */
52 const char *afm_get_font_postscript_name(
54 const char *afm_get_font_name(
57 /* cc -E -dM /dev/null */
59 /* need charset conversion from macintosh to unicode. */
60 extern const unsigned char afm_mac2iso[128];
62 #define afm_fix_osx_charset(c) \
63 ( (c) >= 128 && (c) <= 255 ? afm_mac2iso[(c) - 128] : (c))
66 #define afm_fix_osx_charset(x) (x)