Upload tizen 2.0 beta source
[external/pango1.0.git] / pango / pangoft2-private.h
1 /* Pango
2  * pangoft2-private.h:
3  *
4  * Copyright (C) 1999 Red Hat Software
5  * Copyright (C) 2000 Tor Lillqvist
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 __PANGOFT2_PRIVATE_H__
24 #define __PANGOFT2_PRIVATE_H__
25
26 #include <pango/pangoft2.h>
27 #include <pango/pangofc-fontmap.h>
28 #include <pango/pango-renderer.h>
29 #include <fontconfig/fontconfig.h>
30
31 /* Debugging... */
32 /*#define DEBUGGING 1*/
33
34 #if defined(DEBUGGING) && DEBUGGING
35 #ifdef __GNUC__
36 #define PING(printlist)                                 \
37 (g_print ("%s:%d ", __PRETTY_FUNCTION__, __LINE__),     \
38  g_print printlist,                                     \
39  g_print ("\n"))
40 #else
41 #define PING(printlist)                                 \
42 (g_print ("%s:%d ", __FILE__, __LINE__),                \
43  g_print printlist,                                     \
44  g_print ("\n"))
45 #endif
46 #else  /* !DEBUGGING */
47 #define PING(printlist)
48 #endif
49
50 typedef struct _PangoFT2Font      PangoFT2Font;
51 typedef struct _PangoFT2GlyphInfo PangoFT2GlyphInfo;
52 typedef struct _PangoFT2Renderer  PangoFT2Renderer;
53
54 struct _PangoFT2Font
55 {
56   PangoFcFont font;
57
58   FT_Face face;
59   int load_flags;
60
61   int size;
62
63   GSList *metrics_by_lang;
64
65   GHashTable *glyph_info;
66   GDestroyNotify glyph_cache_destroy;
67 };
68
69 struct _PangoFT2GlyphInfo
70 {
71   PangoRectangle logical_rect;
72   PangoRectangle ink_rect;
73   void *cached_glyph;
74 };
75
76 #define PANGO_TYPE_FT2_FONT              (pango_ft2_font_get_type ())
77 #define PANGO_FT2_FONT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FT2_FONT, PangoFT2Font))
78 #define PANGO_FT2_IS_FONT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FT2_FONT))
79
80 GType pango_ft2_font_get_type (void) G_GNUC_CONST;
81
82 PangoFT2Font * _pango_ft2_font_new                (PangoFT2FontMap   *ft2fontmap,
83                                                    FcPattern         *pattern);
84 FT_Library     _pango_ft2_font_map_get_library    (PangoFontMap      *fontmap);
85 const char    *_pango_ft2_ft_strerror             (FT_Error           error);
86 void _pango_ft2_font_map_default_substitute (PangoFcFontMap *fcfontmap,
87                                              FcPattern      *pattern);
88
89 void *_pango_ft2_font_get_cache_glyph_data    (PangoFont      *font,
90                                                int             glyph_index);
91 void  _pango_ft2_font_set_cache_glyph_data    (PangoFont      *font,
92                                                int             glyph_index,
93                                                void           *cached_glyph);
94 void  _pango_ft2_font_set_glyph_cache_destroy (PangoFont      *font,
95                                                GDestroyNotify  destroy_notify);
96
97 void _pango_ft2_draw_rect            (FT_Bitmap         *bitmap,
98                                       const PangoMatrix *matrix,
99                                       int                x,
100                                       int                y,
101                                       int                width,
102                                       int                height);
103 void _pango_ft2_draw_error_underline (FT_Bitmap         *bitmap,
104                                       const PangoMatrix *matrix,
105                                       int                x,
106                                       int                y,
107                                       int                width,
108                                       int                height);
109
110 #define PANGO_TYPE_FT2_RENDERER            (pango_ft2_renderer_get_type())
111 #define PANGO_FT2_RENDERER(object)         (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FT2_RENDERER, PangoFT2Renderer))
112 #define PANGO_IS_FT2_RENDERER(object)      (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FT2_RENDERER))
113
114 GType pango_ft2_renderer_get_type    (void) G_GNUC_CONST;
115
116 PangoRenderer *_pango_ft2_font_map_get_renderer (PangoFT2FontMap *ft2fontmap);
117
118 #endif /* __PANGOFT2_PRIVATE_H__ */