1 /* Pango
2  * pangofc-font.h: Base fontmap type for fontconfig-based backends
3  *
4  * Copyright (C) 2003 Red Hat Software
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
22 #ifndef __PANGO_FC_FONT_H__
23 #define __PANGO_FC_FONT_H__
24 
25 #include <pango/pango-glyph.h>
26 #include <pango/pango-font.h>
27 #include <pango/pango-glyph.h>
28 
29 /* Freetype has undefined macros in its header */
30 #ifdef PANGO_COMPILATION
31 #pragma GCC diagnostic push
32 #pragma GCC diagnostic ignored "-Wundef"
33 #endif
34 
35 #include <ft2build.h>
36 #include FT_FREETYPE_H
37 #include <fontconfig/fontconfig.h>
38 
39 #ifdef PANGO_COMPILATION
40 #pragma GCC diagnostic pop
41 #endif
42 
43 G_BEGIN_DECLS
44 
45 #ifdef __GI_SCANNER__
46 #define PANGO_FC_TYPE_FONT              (pango_fc_font_get_type ())
47 #define PANGO_FC_FONT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_FC_TYPE_FONT, PangoFcFont))
48 #define PANGO_FC_IS_FONT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_FC_TYPE_FONT))
49 #else
50 #define PANGO_TYPE_FC_FONT              (pango_fc_font_get_type ())
51 #define PANGO_FC_FONT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FC_FONT, PangoFcFont))
52 #define PANGO_IS_FC_FONT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FC_FONT))
53 #endif
54 
55 typedef struct _PangoFcFont      PangoFcFont;
56 typedef struct _PangoFcFontClass PangoFcFontClass;
57 
58 #ifndef PANGO_DISABLE_DEPRECATED
59 
60 /**
61  * PangoFcFont:
62  *
63  * `PangoFcFont` is a base class for font implementations
64  * using the Fontconfig and FreeType libraries.
65  *
66  * It is used in onjunction with [class@PangoFc.FontMap].
67  * When deriving from this class, you need to implement all
68  * of its virtual functions other than shutdown() along with
69  * the get_glyph_extents() virtual function from `PangoFont`.
70  */
71 struct _PangoFcFont
72 {
73   PangoFont parent_instance;
74 
75   FcPattern *font_pattern;          /* fully resolved pattern */
76   PangoFontMap *fontmap;            /* associated map */
77   gpointer priv;                    /* used internally */
78   PangoMatrix matrix;               /* used internally */
79   PangoFontDescription *description;
80 
81   GSList *metrics_by_lang;
82 
83   guint is_hinted : 1;
84   guint is_transformed : 1;
85 };
86 
87 #endif /* PANGO_DISABLE_DEPRECATED */
88 
89 PANGO_AVAILABLE_IN_ALL
90 GType      pango_fc_font_get_type (void) G_GNUC_CONST;
91 
92 PANGO_DEPRECATED_IN_1_44
93 gboolean   pango_fc_font_has_char          (PangoFcFont      *font,
94                                             gunichar          wc);
95 PANGO_AVAILABLE_IN_1_4
96 guint      pango_fc_font_get_glyph         (PangoFcFont      *font,
97                                             gunichar          wc);
98 PANGO_AVAILABLE_IN_1_48
99 PangoLanguage **
100            pango_fc_font_get_languages     (PangoFcFont      *font);
101 
102 PANGO_AVAILABLE_IN_1_48
103 FcPattern *pango_fc_font_get_pattern       (PangoFcFont      *font);
104 
105 PANGO_DEPRECATED_FOR(PANGO_GET_UNKNOWN_GLYPH)
106 PangoGlyph pango_fc_font_get_unknown_glyph (PangoFcFont      *font,
107                                             gunichar          wc);
108 PANGO_DEPRECATED_IN_1_32
109 void       pango_fc_font_kern_glyphs       (PangoFcFont      *font,
110                                             PangoGlyphString *glyphs);
111 
112 PANGO_DEPRECATED_IN_1_44_FOR(pango_font_get_hb_font)
113 FT_Face    pango_fc_font_lock_face         (PangoFcFont      *font);
114 PANGO_DEPRECATED_IN_1_44_FOR(pango_font_get_hb_font)
115 void       pango_fc_font_unlock_face       (PangoFcFont      *font);
116 
117 
118 G_END_DECLS
119 #endif /* __PANGO_FC_FONT_H__ */
120