gdkfont.h 3.45 KB
Newer Older
Manish Singh's avatar
Manish Singh committed
1
#if !defined(GDK_DISABLE_DEPRECATED) || defined(GDK_COMPILATION) || defined(GTK_COMPILATION)
2

Owen Taylor's avatar
Started  
Owen Taylor committed
3 4 5 6
#ifndef __GDK_FONT_H__
#define __GDK_FONT_H__

#include <gdk/gdktypes.h>
7
#include <pango/pango-font.h>
Owen Taylor's avatar
Started  
Owen Taylor committed
8 9 10 11 12

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

13
#define GDK_TYPE_FONT gdk_font_get_type ()
14

Owen Taylor's avatar
Started  
Owen Taylor committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
/* Types of font.
 *   GDK_FONT_FONT: the font is an XFontStruct.
 *   GDK_FONT_FONTSET: the font is an XFontSet used for I18N.
 */
typedef enum
{
  GDK_FONT_FONT,
  GDK_FONT_FONTSET
} GdkFontType;

struct _GdkFont
{
  GdkFontType type;
  gint ascent;
  gint descent;
};

32 33
GType    gdk_font_get_type  (void);

Manish Singh's avatar
Manish Singh committed
34 35 36 37 38
GdkFont* gdk_font_ref	    (GdkFont        *font);
void	 gdk_font_unref	    (GdkFont        *font);
gint	 gdk_font_id	    (const GdkFont  *font);
gboolean gdk_font_equal	    (const GdkFont  *fonta,
			     const GdkFont  *fontb);
39 40 41 42 43 44 45

GdkFont *gdk_font_load_for_display             (GdkDisplay           *display,
						const gchar          *font_name);
GdkFont *gdk_fontset_load_for_display          (GdkDisplay           *display,
						const gchar          *fontset_name);
GdkFont *gdk_font_from_description_for_display (GdkDisplay           *display,
						PangoFontDescription *font_desc);
46

Manish Singh's avatar
Manish Singh committed
47 48 49 50 51 52 53
#ifndef GDK_DISABLE_DEPRECATED

#ifndef GDK_MULTIHEAD_SAFE
GdkFont* gdk_font_load             (const gchar          *font_name);
GdkFont* gdk_fontset_load          (const gchar          *fontset_name);
GdkFont* gdk_font_from_description (PangoFontDescription *font_desc);
#endif
Owen Taylor's avatar
Started  
Owen Taylor committed
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105

gint	 gdk_string_width   (GdkFont        *font,
			     const gchar    *string);
gint	 gdk_text_width	    (GdkFont        *font,
			     const gchar    *text,
			     gint            text_length);
gint	 gdk_text_width_wc  (GdkFont        *font,
			     const GdkWChar *text,
			     gint            text_length);
gint	 gdk_char_width	    (GdkFont        *font,
			     gchar           character);
gint	 gdk_char_width_wc  (GdkFont        *font,
			     GdkWChar        character);
gint	 gdk_string_measure (GdkFont        *font,
			     const gchar    *string);
gint	 gdk_text_measure   (GdkFont        *font,
			     const gchar    *text,
			     gint            text_length);
gint	 gdk_char_measure   (GdkFont        *font,
			     gchar           character);
gint	 gdk_string_height  (GdkFont        *font,
			     const gchar    *string);
gint	 gdk_text_height    (GdkFont        *font,
			     const gchar    *text,
			     gint            text_length);
gint	 gdk_char_height    (GdkFont        *font,
			     gchar           character);

void     gdk_text_extents   (GdkFont     *font,
			     const gchar *text,
			     gint         text_length,
			     gint        *lbearing,
			     gint        *rbearing,
			     gint        *width,
			     gint        *ascent,
			     gint        *descent);
void    gdk_text_extents_wc (GdkFont        *font,
			     const GdkWChar *text,
			     gint            text_length,
			     gint           *lbearing,
			     gint           *rbearing,
			     gint           *width,
			     gint           *ascent,
			     gint           *descent);
void     gdk_string_extents (GdkFont     *font,
			     const gchar *string,
			     gint        *lbearing,
			     gint        *rbearing,
			     gint        *width,
			     gint        *ascent,
			     gint        *descent);

106 107
GdkDisplay * gdk_font_get_display (GdkFont *font);

Manish Singh's avatar
Manish Singh committed
108 109
#endif /* GDK_DISABLE_DEPRECATED */

Owen Taylor's avatar
Started  
Owen Taylor committed
110 111 112 113 114
#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __GDK_FONT_H__ */
115

Manish Singh's avatar
Manish Singh committed
116
#endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION || GTK_COMPILATION */