Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-18 10:28:15

0001 /* Pango
0002  * pango-fontset.h: Font set handling
0003  *
0004  * Copyright (C) 2001 Red Hat Software
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public
0017  * License along with this library; if not, write to the
0018  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0019  * Boston, MA 02111-1307, USA.
0020  */
0021 
0022 #ifndef __PANGO_FONTSET_H__
0023 #define __PANGO_FONTSET_H__
0024 
0025 #include <pango/pango-coverage.h>
0026 #include <pango/pango-types.h>
0027 
0028 #include <glib-object.h>
0029 
0030 G_BEGIN_DECLS
0031 
0032 /*
0033  * PangoFontset
0034  */
0035 
0036 #define PANGO_TYPE_FONTSET              (pango_fontset_get_type ())
0037 #define PANGO_FONTSET(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONTSET, PangoFontset))
0038 #define PANGO_IS_FONTSET(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONTSET))
0039 #define PANGO_FONTSET_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONTSET, PangoFontsetClass))
0040 #define PANGO_IS_FONTSET_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONTSET))
0041 #define PANGO_FONTSET_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONTSET, PangoFontsetClass))
0042 
0043 
0044 PANGO_AVAILABLE_IN_ALL
0045 GType pango_fontset_get_type (void) G_GNUC_CONST;
0046 
0047 typedef struct _PangoFontset        PangoFontset;
0048 typedef struct _PangoFontsetClass   PangoFontsetClass;
0049 
0050 /**
0051  * PangoFontsetForeachFunc:
0052  * @fontset: a `PangoFontset`
0053  * @font: a font from @fontset
0054  * @user_data: callback data
0055  *
0056  * Callback used when enumerating fonts in a fontset.
0057  *
0058  * See [method@Pango.Fontset.foreach].
0059  *
0060  * Returns: if %TRUE, stop iteration and return immediately.
0061  *
0062  * Since: 1.4
0063  */
0064 typedef gboolean (*PangoFontsetForeachFunc) (PangoFontset  *fontset,
0065                                              PangoFont     *font,
0066                                              gpointer       user_data);
0067 
0068 /**
0069  * PangoFontset:
0070  *
0071  * A `PangoFontset` represents a set of `PangoFont` to use when rendering text.
0072  *
0073  * A `PangoFontset` is the result of resolving a `PangoFontDescription`
0074  * against a particular `PangoContext`. It has operations for finding the
0075  * component font for a particular Unicode character, and for finding a
0076  * composite set of metrics for the entire fontset.
0077  */
0078 struct _PangoFontset
0079 {
0080   GObject parent_instance;
0081 };
0082 
0083 /**
0084  * PangoFontsetClass:
0085  * @parent_class: parent `GObjectClass`
0086  * @get_font: a function to get the font in the fontset that contains the
0087  *   best glyph for the given Unicode character; see [method@Pango.Fontset.get_font]
0088  * @get_metrics: a function to get overall metric information for the fonts
0089  *   in the fontset; see [method@Pango.Fontset.get_metrics]
0090  * @get_language: a function to get the language of the fontset.
0091  * @foreach: a function to loop over the fonts in the fontset. See
0092  *   [method@Pango.Fontset.foreach]
0093  *
0094  * The `PangoFontsetClass` structure holds the virtual functions for
0095  * a particular `PangoFontset` implementation.
0096  */
0097 struct _PangoFontsetClass
0098 {
0099   GObjectClass parent_class;
0100 
0101   /*< public >*/
0102 
0103   PangoFont *       (*get_font)     (PangoFontset     *fontset,
0104                                      guint             wc);
0105 
0106   PangoFontMetrics *(*get_metrics)  (PangoFontset     *fontset);
0107   PangoLanguage *   (*get_language) (PangoFontset     *fontset);
0108   void              (*foreach)      (PangoFontset           *fontset,
0109                                      PangoFontsetForeachFunc func,
0110                                      gpointer                data);
0111 
0112   /*< private >*/
0113 
0114   /* Padding for future expansion */
0115   void (*_pango_reserved1) (void);
0116   void (*_pango_reserved2) (void);
0117   void (*_pango_reserved3) (void);
0118   void (*_pango_reserved4) (void);
0119 };
0120 
0121 PANGO_AVAILABLE_IN_ALL
0122 PangoFont *             pango_fontset_get_font          (PangoFontset                   *fontset,
0123                                                          guint                           wc);
0124 PANGO_AVAILABLE_IN_ALL
0125 PangoFontMetrics *      pango_fontset_get_metrics       (PangoFontset                   *fontset);
0126 PANGO_AVAILABLE_IN_1_4
0127 void                    pango_fontset_foreach           (PangoFontset                   *fontset,
0128                                                          PangoFontsetForeachFunc         func,
0129                                                          gpointer                        data);
0130 
0131 
0132 G_END_DECLS
0133 
0134 #endif /* __PANGO_FONTSET_H__ */