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-private.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 | _PANGO_EXTERN |
81 | GType pango_ft2_font_get_type (void) G_GNUC_CONST; |
82 | |
83 | PangoFT2Font * _pango_ft2_font_new (PangoFT2FontMap *ft2fontmap, |
84 | FcPattern *pattern); |
85 | FT_Library _pango_ft2_font_map_get_library (PangoFontMap *fontmap); |
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 | #define PANGO_TYPE_FT2_RENDERER (pango_ft2_renderer_get_type()) |
98 | #define PANGO_FT2_RENDERER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FT2_RENDERER, PangoFT2Renderer)) |
99 | #define PANGO_IS_FT2_RENDERER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FT2_RENDERER)) |
100 | |
101 | _PANGO_EXTERN |
102 | GType pango_ft2_renderer_get_type (void) G_GNUC_CONST; |
103 | |
104 | PangoRenderer *_pango_ft2_font_map_get_renderer (PangoFT2FontMap *ft2fontmap); |
105 | |
106 | #endif /* __PANGOFT2_PRIVATE_H__ */ |
107 | |