1 /* Pango
2  * pangoxft.h:
3  *
4  * Copyright (C) 1999 Red Hat Software
5  * Copyright (C) 2000 SuSE Linux Ltd
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22 
23 #ifndef __PANGOXFT_H__
24 #define __PANGOXFT_H__
25 
26 #include <pango/pangofc-fontmap.h>
27 #include <pango/pango-context.h>
28 #include <pango/pango-ot.h>
29 #include <pango/pangofc-font.h>
30 #include <pango/pango-layout.h>
31 #include <pango/pangoxft-render.h>
32 
33 G_BEGIN_DECLS
34 
35 #ifndef __GI_SCANNER__
36 
37 /**
38  * PANGO_RENDER_TYPE_XFT: (skip)
39  *
40  * A string constant that was used to identify shape engines that work
41  * with the Xft backend. See %PANGO_RENDER_TYPE_FC for the replacement.
42  */
43 #ifndef PANGO_DISABLE_DEPRECATED
44 #define PANGO_RENDER_TYPE_XFT "PangoRenderXft"
45 #endif
46 
47 #endif /* __GI_SCANNER__ */
48 
49 /**
50  * PangoXftFontMap:
51  *
52  * `PangoXftFontMap` is an implementation of `PangoFcFontMap` suitable for
53  * the Xft library as the renderer.  It is used in to create fonts of
54  * type `PangoXftFont`.
55  */
56 
57 /* This is a hack needed because PangoXft hijacks the Pango namespace
58  * for the identifiers, but consumers expect these symbols to be under
59  * the PangoXft namespace.
60  */
61 #ifdef __GI_SCANNER__
62 #define PANGO_XFT_TYPE_FONT_MAP         (pango_xft_font_map_get_type())
63 #define PANGO_XFT_FONT_MAP(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), PANGO_XFT_TYPE_FONT_MAP, PangoXftFontMap))
64 #define PANGO_XFT_IS_FONT_MAP(obj)      (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PANGO_XFT_TYPE_FONT_MAP))
65 #else
66 #define PANGO_TYPE_XFT_FONT_MAP         (pango_xft_font_map_get_type ())
67 #define PANGO_XFT_FONT_MAP(object)      (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_XFT_FONT_MAP, PangoXftFontMap))
68 #define PANGO_XFT_IS_FONT_MAP(object)   (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_XFT_FONT_MAP))
69 #endif
70 
71 typedef struct _PangoXftFontMap      PangoXftFontMap;
72 
73 /**
74  * PangoXftFont:
75  *
76  * `PangoXftFont` is an implementation of `PangoFcFont` using the Xft
77  * library for rendering.  It is used in conjunction with `PangoXftFontMap`.
78  */
79 typedef struct _PangoXftFont    PangoXftFont;
80 
81 /**
82  * PangoXftSubstituteFunc:
83  * @pattern: the FcPattern to tweak.
84  * @data: user data.
85  *
86  * Function type for doing final config tweaking on prepared FcPatterns.
87  */
88 typedef void (*PangoXftSubstituteFunc) (FcPattern *pattern,
89 				        gpointer   data);
90 
91 /* Calls for applications
92  */
93 PANGO_AVAILABLE_IN_1_2
94 PangoFontMap *pango_xft_get_font_map     (Display *display,
95 					  int      screen);
96 #ifndef PANGO_DISABLE_DEPRECATED
97 PANGO_DEPRECATED
98 PangoContext *pango_xft_get_context      (Display *display,
99 					  int      screen);
100 #endif
101 PANGO_AVAILABLE_IN_1_2
102 void          pango_xft_shutdown_display (Display *display,
103 					  int      screen);
104 
105 #ifndef PANGO_DISABLE_DEPRECATED
106 PANGO_DEPRECATED_IN_1_48_FOR(pango_fc_font_map_set_default_substitute)
107 void pango_xft_set_default_substitute (Display                *display,
108 				       int                     screen,
109 				       PangoXftSubstituteFunc  func,
110 				       gpointer                data,
111 				       GDestroyNotify          notify);
112 PANGO_DEPRECATED_IN_1_48_FOR(pango_fc_font_map_substitute_changed)
113 void pango_xft_substitute_changed     (Display                *display,
114 				       int                     screen);
115 #endif
116 
117 PANGO_AVAILABLE_IN_ALL
118 GType pango_xft_font_map_get_type (void) G_GNUC_CONST;
119 
120 #ifdef __GI_SCANNER__
121 #define PANGO_XFT_TYPE_FONT              (pango_xft_font_get_type ())
122 #define PANGO_XFT_FONT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_XFT_TYPE_FONT, PangoXftFont))
123 #define PANGO_XFT_IS_FONT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_XFT_TYPE_FONT))
124 #else
125 #define PANGO_TYPE_XFT_FONT              (pango_xft_font_get_type ())
126 #define PANGO_XFT_FONT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_XFT_FONT, PangoXftFont))
127 #define PANGO_XFT_IS_FONT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_XFT_FONT))
128 #endif
129 
130 PANGO_AVAILABLE_IN_ALL
131 GType      pango_xft_font_get_type (void) G_GNUC_CONST;
132 
133 /* For shape engines
134  */
135 
136 #ifndef PANGO_DISABLE_DEPRECATED
137 
138 PANGO_DEPRECATED
139 XftFont *     pango_xft_font_get_font          (PangoFont *font);
140 PANGO_DEPRECATED
141 Display *     pango_xft_font_get_display       (PangoFont *font);
142 PANGO_DEPRECATED_FOR(pango_fc_font_lock_face)
143 FT_Face       pango_xft_font_lock_face         (PangoFont *font);
144 PANGO_DEPRECATED_FOR(pango_fc_font_unlock_face)
145 void	      pango_xft_font_unlock_face       (PangoFont *font);
146 PANGO_DEPRECATED_FOR(pango_fc_font_get_glyph)
147 guint	      pango_xft_font_get_glyph	       (PangoFont *font,
148 						gunichar   wc);
149 PANGO_DEPRECATED_FOR(pango_fc_font_has_char)
150 gboolean      pango_xft_font_has_char          (PangoFont *font,
151 						gunichar   wc);
152 PANGO_DEPRECATED_FOR(PANGO_GET_UNKNOWN_GLYPH)
153 PangoGlyph    pango_xft_font_get_unknown_glyph (PangoFont *font,
154 						gunichar   wc);
155 #endif /* PANGO_DISABLE_DEPRECATED */
156 
157 G_END_DECLS
158 
159 #endif /* __PANGOXFT_H__ */
160