]> icculus.org git repositories - dana/openbox.git/blob - glft/font.h
improve expose handling for alpha children
[dana/openbox.git] / glft / font.h
1 #ifndef __glft_font_h
2 #define __glft_font_h
3
4 #include <fontconfig/fontconfig.h>
5
6 #include <ft2build.h>
7 #include FT_FREETYPE_H
8 #include <fontconfig/fcfreetype.h>
9
10 #include <X11/Xlib.h>
11 #include <glib.h>
12
13 struct GlftFont {
14     Display *display;
15     int screen;
16
17     FcPattern *pat;
18     FcCharSet *chars;
19
20     char *filename;
21     int index;
22
23     FT_Face face;
24     FT_Int ftflags;
25     FT_F26Dot6 ftcharsize;
26
27     FcBool antialias;
28     int spacing;
29     FcBool minspace;
30     int char_width;
31     /* extended font attributes */
32     FcBool shadow;
33     int shadow_offset;
34     float shadow_alpha;
35
36     GHashTable *glyph_map;
37
38     int kerning : 1;
39
40     /* public shit */
41     int ascent;
42     int descent;
43     int height;
44     int max_advance_width;
45 };
46
47 struct GlftGlyph {
48     /* The character in UCS-4 encoding */
49     FcChar32 w;
50     /* OpenGL texture for the character */
51     unsigned int tnum;
52     /* The FT_Face glyph */
53     FT_UInt glyph;
54
55     int x;
56     int y;
57     int width;
58     int height;
59
60     int padx, pady;
61     int texw, texh;
62     int left, yoff;
63 };
64
65 /*! Takes a character in UTF-8 encoding and returns an OpenGL display list
66  for it */
67 struct GlftGlyph *GlftFontGlyph(struct GlftFont *font, const char *c);
68
69 int GlftFontAdvance(struct GlftFont *font,
70                     struct GlftGlyph *left,
71                     struct GlftGlyph *right);
72
73 #endif