| 1 | /* Pango |
| 2 | * pango-fontset.h: Font set handling |
| 3 | * |
| 4 | * Copyright (C) 2001 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_FONTSET_H__ |
| 23 | #define __PANGO_FONTSET_H__ |
| 24 | |
| 25 | #include <pango/pango-coverage.h> |
| 26 | #include <pango/pango-types.h> |
| 27 | |
| 28 | #include <glib-object.h> |
| 29 | |
| 30 | G_BEGIN_DECLS |
| 31 | |
| 32 | /* |
| 33 | * PangoFontset |
| 34 | */ |
| 35 | |
| 36 | #define PANGO_TYPE_FONTSET (pango_fontset_get_type ()) |
| 37 | #define PANGO_FONTSET(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONTSET, PangoFontset)) |
| 38 | #define PANGO_IS_FONTSET(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONTSET)) |
| 39 | #define PANGO_FONTSET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONTSET, PangoFontsetClass)) |
| 40 | #define PANGO_IS_FONTSET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONTSET)) |
| 41 | #define PANGO_FONTSET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONTSET, PangoFontsetClass)) |
| 42 | |
| 43 | |
| 44 | PANGO_AVAILABLE_IN_ALL |
| 45 | GType pango_fontset_get_type (void) G_GNUC_CONST; |
| 46 | |
| 47 | typedef struct _PangoFontset PangoFontset; |
| 48 | typedef struct _PangoFontsetClass PangoFontsetClass; |
| 49 | |
| 50 | /** |
| 51 | * PangoFontsetForeachFunc: |
| 52 | * @fontset: a `PangoFontset` |
| 53 | * @font: a font from @fontset |
| 54 | * @user_data: callback data |
| 55 | * |
| 56 | * Callback used when enumerating fonts in a fontset. |
| 57 | * |
| 58 | * See [method@Pango.Fontset.foreach]. |
| 59 | * |
| 60 | * Returns: if %TRUE, stop iteration and return immediately. |
| 61 | * |
| 62 | * Since: 1.4 |
| 63 | */ |
| 64 | typedef gboolean (*PangoFontsetForeachFunc) (PangoFontset *fontset, |
| 65 | PangoFont *font, |
| 66 | gpointer user_data); |
| 67 | |
| 68 | /** |
| 69 | * PangoFontset: |
| 70 | * |
| 71 | * A `PangoFontset` represents a set of `PangoFont` to use when rendering text. |
| 72 | * |
| 73 | * A `PangoFontset` is the result of resolving a `PangoFontDescription` |
| 74 | * against a particular `PangoContext`. It has operations for finding the |
| 75 | * component font for a particular Unicode character, and for finding a |
| 76 | * composite set of metrics for the entire fontset. |
| 77 | */ |
| 78 | struct _PangoFontset |
| 79 | { |
| 80 | GObject parent_instance; |
| 81 | }; |
| 82 | |
| 83 | /** |
| 84 | * PangoFontsetClass: |
| 85 | * @parent_class: parent `GObjectClass` |
| 86 | * @get_font: a function to get the font in the fontset that contains the |
| 87 | * best glyph for the given Unicode character; see [method@Pango.Fontset.get_font] |
| 88 | * @get_metrics: a function to get overall metric information for the fonts |
| 89 | * in the fontset; see [method@Pango.Fontset.get_metrics] |
| 90 | * @get_language: a function to get the language of the fontset. |
| 91 | * @foreach: a function to loop over the fonts in the fontset. See |
| 92 | * [method@Pango.Fontset.foreach] |
| 93 | * |
| 94 | * The `PangoFontsetClass` structure holds the virtual functions for |
| 95 | * a particular `PangoFontset` implementation. |
| 96 | */ |
| 97 | struct _PangoFontsetClass |
| 98 | { |
| 99 | GObjectClass parent_class; |
| 100 | |
| 101 | /*< public >*/ |
| 102 | |
| 103 | PangoFont * (*get_font) (PangoFontset *fontset, |
| 104 | guint wc); |
| 105 | |
| 106 | PangoFontMetrics *(*get_metrics) (PangoFontset *fontset); |
| 107 | PangoLanguage * (*get_language) (PangoFontset *fontset); |
| 108 | void (*foreach) (PangoFontset *fontset, |
| 109 | PangoFontsetForeachFunc func, |
| 110 | gpointer data); |
| 111 | |
| 112 | /*< private >*/ |
| 113 | |
| 114 | /* Padding for future expansion */ |
| 115 | void (*_pango_reserved1) (void); |
| 116 | void (*_pango_reserved2) (void); |
| 117 | void (*_pango_reserved3) (void); |
| 118 | void (*_pango_reserved4) (void); |
| 119 | }; |
| 120 | |
| 121 | PANGO_AVAILABLE_IN_ALL |
| 122 | PangoFont * pango_fontset_get_font (PangoFontset *fontset, |
| 123 | guint wc); |
| 124 | PANGO_AVAILABLE_IN_ALL |
| 125 | PangoFontMetrics * pango_fontset_get_metrics (PangoFontset *fontset); |
| 126 | PANGO_AVAILABLE_IN_1_4 |
| 127 | void pango_fontset_foreach (PangoFontset *fontset, |
| 128 | PangoFontsetForeachFunc func, |
| 129 | gpointer data); |
| 130 | |
| 131 | |
| 132 | G_END_DECLS |
| 133 | |
| 134 | #endif /* __PANGO_FONTSET_H__ */ |
| 135 | |