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