]> icculus.org git repositories - dana/openbox.git/blob - glft/glft.h
better font layout
[dana/openbox.git] / glft / glft.h
1 #ifndef __glft_h__
2 #define __glft_h__
3
4 #include <fontconfig/fontconfig.h>
5 #include <X11/Xlib.h>
6
7 /* initialization */
8
9 FcBool GlftInit();
10
11 /* fonts */
12
13 struct GlftFont;
14
15 struct GlftFont *GlftFontOpen(Display *d, int screen, const char *name);
16
17 void GlftFontClose(struct GlftFont *font);
18
19 /* rendering */
20
21 struct GlftColor {
22     float r;
23     float g;
24     float b;
25     float a;
26 };
27
28 /*! Renders a string in UTF-8 encoding */
29 void GlftRenderString(struct GlftFont *font,
30                       const char *str,
31                       int bytes,
32                       struct GlftColor *color,
33                       int x,
34                       int y);
35
36 /* metrics */
37
38 /*! Measures a string in UTF-8 encoding */
39 void GlftMeasureString(struct GlftFont *font,
40                        const char *str,
41                        int bytes,
42                        int *w,
43                        int *h);
44
45 int GlftFontAscent(struct GlftFont *font);
46 int GlftFontDescent(struct GlftFont *font);
47 int GlftFontHeight(struct GlftFont *font);
48 int GlftFontMaxCharWidth(struct GlftFont *font);
49
50 #endif