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
29G_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
38typedef 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 */
49struct _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 */
72struct _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
101PANGO_AVAILABLE_IN_ALL
102GType pango_font_map_get_type (void) G_GNUC_CONST;
103PANGO_AVAILABLE_IN_1_22
104PangoContext * pango_font_map_create_context (PangoFontMap *fontmap);
105PANGO_AVAILABLE_IN_ALL
106PangoFont * pango_font_map_load_font (PangoFontMap *fontmap,
107 PangoContext *context,
108 const PangoFontDescription *desc);
109PANGO_AVAILABLE_IN_ALL
110PangoFontset *pango_font_map_load_fontset (PangoFontMap *fontmap,
111 PangoContext *context,
112 const PangoFontDescription *desc,
113 PangoLanguage *language);
114PANGO_AVAILABLE_IN_ALL
115void pango_font_map_list_families (PangoFontMap *fontmap,
116 PangoFontFamily ***families,
117 int *n_families);
118PANGO_AVAILABLE_IN_1_32
119guint pango_font_map_get_serial (PangoFontMap *fontmap);
120PANGO_AVAILABLE_IN_1_34
121void pango_font_map_changed (PangoFontMap *fontmap);
122
123PANGO_AVAILABLE_IN_1_46
124PangoFontFamily *pango_font_map_get_family (PangoFontMap *fontmap,
125 const char *name);
126
127
128G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoFontMap, g_object_unref)
129
130G_END_DECLS
131
132#endif /* __PANGO_FONTMAP_H__ */
133

source code of include/pango-1.0/pango/pango-fontmap.h