1 | /* Pango |
2 | * pango-font.h: Font handling |
3 | * |
4 | * Copyright (C) 2000 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_FONTMAP_H__ |
23 | #define __PANGO_FONTMAP_H__ |
24 | |
25 | #include <pango/pango-types.h> |
26 | #include <pango/pango-font.h> |
27 | #include <pango/pango-fontset.h> |
28 | |
29 | G_BEGIN_DECLS |
30 | |
31 | #define PANGO_TYPE_FONT_MAP (pango_font_map_get_type ()) |
32 | #define PANGO_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_MAP, PangoFontMap)) |
33 | #define PANGO_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_MAP)) |
34 | #define PANGO_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_MAP, PangoFontMapClass)) |
35 | #define PANGO_IS_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_MAP)) |
36 | #define PANGO_FONT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_MAP, PangoFontMapClass)) |
37 | |
38 | typedef struct _PangoFontMapClass PangoFontMapClass; |
39 | |
40 | /** |
41 | * PangoFontMap: |
42 | * |
43 | * A `PangoFontMap` represents the set of fonts available for a |
44 | * particular rendering system. |
45 | * |
46 | * This is a virtual object with implementations being specific to |
47 | * particular rendering systems. |
48 | */ |
49 | struct _PangoFontMap |
50 | { |
51 | GObject parent_instance; |
52 | }; |
53 | |
54 | /** |
55 | * PangoFontMapClass: |
56 | * @parent_class: parent `GObjectClass` |
57 | * @load_font: a function to load a font with a given description. See |
58 | * pango_font_map_load_font(). |
59 | * @list_families: A function to list available font families. See |
60 | * pango_font_map_list_families(). |
61 | * @load_fontset: a function to load a fontset with a given given description |
62 | * suitable for a particular language. See pango_font_map_load_fontset(). |
63 | * @shape_engine_type: the type of rendering-system-dependent engines that |
64 | * can handle fonts of this fonts loaded with this fontmap. |
65 | * @get_serial: a function to get the serial number of the fontmap. |
66 | * See pango_font_map_get_serial(). |
67 | * @changed: See pango_font_map_changed() |
68 | * |
69 | * The `PangoFontMapClass` structure holds the virtual functions for |
70 | * a particular `PangoFontMap` implementation. |
71 | */ |
72 | struct _PangoFontMapClass |
73 | { |
74 | GObjectClass parent_class; |
75 | |
76 | /*< public >*/ |
77 | |
78 | PangoFont * (*load_font) (PangoFontMap *fontmap, |
79 | PangoContext *context, |
80 | const PangoFontDescription *desc); |
81 | void (*list_families) (PangoFontMap *fontmap, |
82 | PangoFontFamily ***families, |
83 | int *n_families); |
84 | PangoFontset *(*load_fontset) (PangoFontMap *fontmap, |
85 | PangoContext *context, |
86 | const PangoFontDescription *desc, |
87 | PangoLanguage *language); |
88 | |
89 | const char *shape_engine_type; |
90 | |
91 | guint (*get_serial) (PangoFontMap *fontmap); |
92 | void (*changed) (PangoFontMap *fontmap); |
93 | |
94 | PangoFontFamily * (*get_family) (PangoFontMap *fontmap, |
95 | const char *name); |
96 | |
97 | PangoFontFace * (*get_face) (PangoFontMap *fontmap, |
98 | PangoFont *font); |
99 | }; |
100 | |
101 | PANGO_AVAILABLE_IN_ALL |
102 | GType pango_font_map_get_type (void) G_GNUC_CONST; |
103 | PANGO_AVAILABLE_IN_1_22 |
104 | PangoContext * pango_font_map_create_context (PangoFontMap *fontmap); |
105 | PANGO_AVAILABLE_IN_ALL |
106 | PangoFont * pango_font_map_load_font (PangoFontMap *fontmap, |
107 | PangoContext *context, |
108 | const PangoFontDescription *desc); |
109 | PANGO_AVAILABLE_IN_ALL |
110 | PangoFontset *pango_font_map_load_fontset (PangoFontMap *fontmap, |
111 | PangoContext *context, |
112 | const PangoFontDescription *desc, |
113 | PangoLanguage *language); |
114 | PANGO_AVAILABLE_IN_ALL |
115 | void pango_font_map_list_families (PangoFontMap *fontmap, |
116 | PangoFontFamily ***families, |
117 | int *n_families); |
118 | PANGO_AVAILABLE_IN_1_32 |
119 | guint pango_font_map_get_serial (PangoFontMap *fontmap); |
120 | PANGO_AVAILABLE_IN_1_34 |
121 | void pango_font_map_changed (PangoFontMap *fontmap); |
122 | |
123 | PANGO_AVAILABLE_IN_1_46 |
124 | PangoFontFamily *pango_font_map_get_family (PangoFontMap *fontmap, |
125 | const char *name); |
126 | |
127 | |
128 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoFontMap, g_object_unref) |
129 | |
130 | G_END_DECLS |
131 | |
132 | #endif /* __PANGO_FONTMAP_H__ */ |
133 | |