]> Pileus Git - ~andy/gtk/blob - gdk/gdkfont.h
Fix typo, where x value was assigned to both x and y.
[~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 GdkFont* gdk_font_load             (const gchar          *font_name);
35 GdkFont* gdk_fontset_load          (const gchar          *fontset_name);
36 GdkFont* gdk_font_from_description (PangoFontDescription *font_desc);
37
38 GdkFont* gdk_font_ref       (GdkFont        *font);
39 void     gdk_font_unref     (GdkFont        *font);
40 gint     gdk_font_id        (const GdkFont  *font);
41 gboolean gdk_font_equal     (const GdkFont  *fonta,
42                              const GdkFont  *fontb);
43
44 gint     gdk_string_width   (GdkFont        *font,
45                              const gchar    *string);
46 gint     gdk_text_width     (GdkFont        *font,
47                              const gchar    *text,
48                              gint            text_length);
49 gint     gdk_text_width_wc  (GdkFont        *font,
50                              const GdkWChar *text,
51                              gint            text_length);
52 gint     gdk_char_width     (GdkFont        *font,
53                              gchar           character);
54 gint     gdk_char_width_wc  (GdkFont        *font,
55                              GdkWChar        character);
56 gint     gdk_string_measure (GdkFont        *font,
57                              const gchar    *string);
58 gint     gdk_text_measure   (GdkFont        *font,
59                              const gchar    *text,
60                              gint            text_length);
61 gint     gdk_char_measure   (GdkFont        *font,
62                              gchar           character);
63 gint     gdk_string_height  (GdkFont        *font,
64                              const gchar    *string);
65 gint     gdk_text_height    (GdkFont        *font,
66                              const gchar    *text,
67                              gint            text_length);
68 gint     gdk_char_height    (GdkFont        *font,
69                              gchar           character);
70
71 void     gdk_text_extents   (GdkFont     *font,
72                              const gchar *text,
73                              gint         text_length,
74                              gint        *lbearing,
75                              gint        *rbearing,
76                              gint        *width,
77                              gint        *ascent,
78                              gint        *descent);
79 void    gdk_text_extents_wc (GdkFont        *font,
80                              const GdkWChar *text,
81                              gint            text_length,
82                              gint           *lbearing,
83                              gint           *rbearing,
84                              gint           *width,
85                              gint           *ascent,
86                              gint           *descent);
87 void     gdk_string_extents (GdkFont     *font,
88                              const gchar *string,
89                              gint        *lbearing,
90                              gint        *rbearing,
91                              gint        *width,
92                              gint        *ascent,
93                              gint        *descent);
94
95 #ifdef GDK_WINDOWING_WIN32
96 /* Ditto temporary */
97 gchar*   gdk_font_full_name_get (GdkFont *font);
98 void     gdk_font_full_name_free (gchar *name);
99 #endif
100
101 #ifdef __cplusplus
102 }
103 #endif /* __cplusplus */
104
105 #endif /* __GDK_FONT_H__ */
106
107 #endif /* GDK_DISABLE_DEPRECATED */