]> Pileus Git - ~andy/gtk/blob - gdk/gdkfont.h
Start of integration of Erwann Chenede's multihead work from the
[~andy/gtk] / gdk / gdkfont.h
1 #ifndef GDK_DISABLE_DEPRECATED
2
3 #ifndef __GDK_FONT_H__
4 #define __GDK_FONT_H__
5
6 #include <gdk/gdktypes.h>
7 #include <pango/pango-font.h>
8
9 #ifdef __cplusplus
10 extern "C" {
11 #endif /* __cplusplus */
12
13 #define GDK_TYPE_FONT gdk_font_get_type ()
14
15 /* Types of font.
16  *   GDK_FONT_FONT: the font is an XFontStruct.
17  *   GDK_FONT_FONTSET: the font is an XFontSet used for I18N.
18  */
19 typedef enum
20 {
21   GDK_FONT_FONT,
22   GDK_FONT_FONTSET
23 } GdkFontType;
24
25 struct _GdkFont
26 {
27   GdkFontType type;
28   gint ascent;
29   gint descent;
30 };
31
32 GType    gdk_font_get_type  (void);
33
34 #ifndef GDK_MULTIHEAD_SAFE
35 GdkFont* gdk_font_load             (const gchar          *font_name);
36 GdkFont* gdk_fontset_load          (const gchar          *fontset_name);
37 GdkFont* gdk_font_from_description (PangoFontDescription *font_desc);
38 #endif
39
40 GdkFont *gdk_font_load_for_display             (GdkDisplay           *display,
41                                                 const gchar          *font_name);
42 GdkFont *gdk_fontset_load_for_display          (GdkDisplay           *display,
43                                                 const gchar          *fontset_name);
44 GdkFont *gdk_font_from_description_for_display (GdkDisplay           *display,
45                                                 PangoFontDescription *font_desc);
46
47 GdkFont* gdk_font_ref       (GdkFont        *font);
48 void     gdk_font_unref     (GdkFont        *font);
49 gint     gdk_font_id        (const GdkFont  *font);
50 gboolean gdk_font_equal     (const GdkFont  *fonta,
51                              const GdkFont  *fontb);
52
53 gint     gdk_string_width   (GdkFont        *font,
54                              const gchar    *string);
55 gint     gdk_text_width     (GdkFont        *font,
56                              const gchar    *text,
57                              gint            text_length);
58 gint     gdk_text_width_wc  (GdkFont        *font,
59                              const GdkWChar *text,
60                              gint            text_length);
61 gint     gdk_char_width     (GdkFont        *font,
62                              gchar           character);
63 gint     gdk_char_width_wc  (GdkFont        *font,
64                              GdkWChar        character);
65 gint     gdk_string_measure (GdkFont        *font,
66                              const gchar    *string);
67 gint     gdk_text_measure   (GdkFont        *font,
68                              const gchar    *text,
69                              gint            text_length);
70 gint     gdk_char_measure   (GdkFont        *font,
71                              gchar           character);
72 gint     gdk_string_height  (GdkFont        *font,
73                              const gchar    *string);
74 gint     gdk_text_height    (GdkFont        *font,
75                              const gchar    *text,
76                              gint            text_length);
77 gint     gdk_char_height    (GdkFont        *font,
78                              gchar           character);
79
80 void     gdk_text_extents   (GdkFont     *font,
81                              const gchar *text,
82                              gint         text_length,
83                              gint        *lbearing,
84                              gint        *rbearing,
85                              gint        *width,
86                              gint        *ascent,
87                              gint        *descent);
88 void    gdk_text_extents_wc (GdkFont        *font,
89                              const GdkWChar *text,
90                              gint            text_length,
91                              gint           *lbearing,
92                              gint           *rbearing,
93                              gint           *width,
94                              gint           *ascent,
95                              gint           *descent);
96 void     gdk_string_extents (GdkFont     *font,
97                              const gchar *string,
98                              gint        *lbearing,
99                              gint        *rbearing,
100                              gint        *width,
101                              gint        *ascent,
102                              gint        *descent);
103
104 GdkDisplay * gdk_font_get_display (GdkFont *font);
105
106 #ifdef GDK_WINDOWING_WIN32
107 /* Ditto temporary */
108 gchar*   gdk_font_full_name_get (GdkFont *font);
109 void     gdk_font_full_name_free (gchar *name);
110 #endif
111
112 #ifdef __cplusplus
113 }
114 #endif /* __cplusplus */
115
116 #endif /* __GDK_FONT_H__ */
117
118 #endif /* GDK_DISABLE_DEPRECATED */