bf26a1abe525ccb7f688263d0c8939e818a8280e
[rrdtool.git] / src / rrd_afm.h
1 /****************************************************************************
2  * RRDtool 1.2rc8  Copyright by Tobi Oetiker, 1997-2005
3  ****************************************************************************
4  * rrd_afm.h  Parsing afm tables to find width of strings.
5  ****************************************************************************/
6
7 #ifndef  RRD_AFM_H
8 #define RRD_AFM_H
9
10 /* measure width of a text string */
11 /* fontname can be full name or postscript name */
12 double afm_get_text_width ( double start, const char* font, double size,
13                             double tabwidth, const char* text);
14
15 /* get postscript name from fullname or postscript name */
16 const char *afm_get_font_postscript_name ( const char* font);
17
18 /* cc -E -dM /dev/null */
19 #ifdef __APPLE__
20 /* need charset conversion from macintosh to unicode. */
21 extern const unsigned char afm_mac2iso[128];
22 #define afm_host2unicode(c) \
23         ( (c) >= 128 ? afm_mac2iso[(c) - 128] : (c))
24 #else
25 /* UNSAFE macro */
26 #define afm_host2unicode(a_unsigned_char) ((unsigned int)(a_unsigned_char))
27 #endif
28
29 #endif