Revert "Remove dead 'uses_root' flag from WScreen"
[notion.git] / de / font.h
blob6ba3fe840558f697039e49a25fb1eed4edafee42
1 /*
2 * ion/de/font.h
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
7 */
9 #ifndef ION_DE_FONT_H
10 #define ION_DE_FONT_H
12 #include <ioncore/common.h>
13 #include <ioncore/gr.h>
15 INTRSTRUCT(DEFont);
17 #include "brush.h"
18 #include "colour.h"
19 #include "style.h"
21 #define DE_RESET_FONT_EXTENTS(FNTE) \
22 {(FNTE)->max_height=0; (FNTE)->max_width=0; (FNTE)->baseline=0;}
24 DECLSTRUCT(DEFont){
25 char *pattern;
26 int refcount;
27 XFontSet fontset;
28 XFontStruct *fontstruct;
29 DEFont *next, *prev;
32 extern bool de_load_font_for_style(DEStyle *style, const char *fontname);
33 extern bool de_set_font_for_style(DEStyle *style, DEFont *font);
34 extern DEFont *de_load_font(const char *fontname);
35 extern void de_free_font(DEFont *font);
37 extern void debrush_draw_string(DEBrush *brush, int x, int y,
38 const char *str, int len, bool needfill);
39 extern void debrush_do_draw_string(DEBrush *brush, int x, int y,
40 const char *str, int len, bool needfill,
41 DEColourGroup *colours);
42 extern void debrush_do_draw_string_default(DEBrush *brush, int x, int y,
43 const char *str, int len,
44 bool needfill,
45 DEColourGroup *colours);
47 extern void debrush_get_font_extents(DEBrush *brush, GrFontExtents *fnte);
49 extern uint debrush_get_text_width(DEBrush *brush, const char *text, uint len);
51 extern uint defont_get_text_width(DEFont *font, const char *text, uint len);
52 extern void defont_get_font_extents(DEFont *font, GrFontExtents *fnte);
54 #endif /* ION_DE_FONT_H */