Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /* Pango
0002  * pango-font.h: Font handling
0003  *
0004  * Copyright (C) 2000 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_FONT_H__
0023 #define __PANGO_FONT_H__
0024 
0025 #include <pango/pango-coverage.h>
0026 #include <pango/pango-types.h>
0027 
0028 #include <glib-object.h>
0029 #include <hb.h>
0030 
0031 G_BEGIN_DECLS
0032 
0033 /**
0034  * PangoFontDescription:
0035  *
0036  * A `PangoFontDescription` describes a font in an implementation-independent
0037  * manner.
0038  *
0039  * `PangoFontDescription` structures are used both to list what fonts are
0040  * available on the system and also for specifying the characteristics of
0041  * a font to load.
0042  */
0043 typedef struct _PangoFontDescription PangoFontDescription;
0044 
0045 /**
0046  * PangoFontMetrics:
0047  *
0048  * A `PangoFontMetrics` structure holds the overall metric information
0049  * for a font.
0050  *
0051  * The information in a `PangoFontMetrics` structure may be restricted
0052  * to a script. The fields of this structure are private to implementations
0053  * of a font backend. See the documentation of the corresponding getters
0054  * for documentation of their meaning.
0055  *
0056  * For an overview of the most important metrics, see:
0057  *
0058  * <picture>
0059  *   <source srcset="fontmetrics-dark.png" media="(prefers-color-scheme: dark)">
0060  *   <img alt="Font metrics" src="fontmetrics-light.png">
0061  * </picture>
0062 
0063  */
0064 typedef struct _PangoFontMetrics PangoFontMetrics;
0065 
0066 /**
0067  * PangoStyle:
0068  * @PANGO_STYLE_NORMAL: the font is upright.
0069  * @PANGO_STYLE_OBLIQUE: the font is slanted, but in a roman style.
0070  * @PANGO_STYLE_ITALIC: the font is slanted in an italic style.
0071  *
0072  * An enumeration specifying the various slant styles possible for a font.
0073  **/
0074 typedef enum {
0075   PANGO_STYLE_NORMAL,
0076   PANGO_STYLE_OBLIQUE,
0077   PANGO_STYLE_ITALIC
0078 } PangoStyle;
0079 
0080 /**
0081  * PangoVariant:
0082  * @PANGO_VARIANT_NORMAL: A normal font.
0083  * @PANGO_VARIANT_SMALL_CAPS: A font with the lower case characters
0084  *   replaced by smaller variants of the capital characters.
0085  * @PANGO_VARIANT_ALL_SMALL_CAPS: A font with all characters
0086  *   replaced by smaller variants of the capital characters. Since: 1.50
0087  * @PANGO_VARIANT_PETITE_CAPS: A font with the lower case characters
0088  *   replaced by smaller variants of the capital characters.
0089  *   Petite Caps can be even smaller than Small Caps. Since: 1.50
0090  * @PANGO_VARIANT_ALL_PETITE_CAPS: A font with all characters
0091  *   replaced by smaller variants of the capital characters.
0092  *   Petite Caps can be even smaller than Small Caps. Since: 1.50
0093  * @PANGO_VARIANT_UNICASE: A font with the upper case characters
0094  *   replaced by smaller variants of the capital letters. Since: 1.50
0095  * @PANGO_VARIANT_TITLE_CAPS: A font with capital letters that
0096  *   are more suitable for all-uppercase titles. Since: 1.50
0097  *
0098  * An enumeration specifying capitalization variant of the font.
0099  */
0100 typedef enum {
0101   PANGO_VARIANT_NORMAL,
0102   PANGO_VARIANT_SMALL_CAPS,
0103   PANGO_VARIANT_ALL_SMALL_CAPS,
0104   PANGO_VARIANT_PETITE_CAPS,
0105   PANGO_VARIANT_ALL_PETITE_CAPS,
0106   PANGO_VARIANT_UNICASE,
0107   PANGO_VARIANT_TITLE_CAPS
0108 } PangoVariant;
0109 
0110 /**
0111  * PangoWeight:
0112  * @PANGO_WEIGHT_THIN: the thin weight (= 100) Since: 1.24
0113  * @PANGO_WEIGHT_ULTRALIGHT: the ultralight weight (= 200)
0114  * @PANGO_WEIGHT_LIGHT: the light weight (= 300)
0115  * @PANGO_WEIGHT_SEMILIGHT: the semilight weight (= 350) Since: 1.36.7
0116  * @PANGO_WEIGHT_BOOK: the book weight (= 380) Since: 1.24)
0117  * @PANGO_WEIGHT_NORMAL: the default weight (= 400)
0118  * @PANGO_WEIGHT_MEDIUM: the medium weight (= 500) Since: 1.24
0119  * @PANGO_WEIGHT_SEMIBOLD: the semibold weight (= 600)
0120  * @PANGO_WEIGHT_BOLD: the bold weight (= 700)
0121  * @PANGO_WEIGHT_ULTRABOLD: the ultrabold weight (= 800)
0122  * @PANGO_WEIGHT_HEAVY: the heavy weight (= 900)
0123  * @PANGO_WEIGHT_ULTRAHEAVY: the ultraheavy weight (= 1000) Since: 1.24
0124  *
0125  * An enumeration specifying the weight (boldness) of a font.
0126  *
0127  * Weight is specified as a numeric value ranging from 100 to 1000.
0128  * This enumeration simply provides some common, predefined values.
0129  */
0130 typedef enum {
0131   PANGO_WEIGHT_THIN = 100,
0132   PANGO_WEIGHT_ULTRALIGHT = 200,
0133   PANGO_WEIGHT_LIGHT = 300,
0134   PANGO_WEIGHT_SEMILIGHT = 350,
0135   PANGO_WEIGHT_BOOK = 380,
0136   PANGO_WEIGHT_NORMAL = 400,
0137   PANGO_WEIGHT_MEDIUM = 500,
0138   PANGO_WEIGHT_SEMIBOLD = 600,
0139   PANGO_WEIGHT_BOLD = 700,
0140   PANGO_WEIGHT_ULTRABOLD = 800,
0141   PANGO_WEIGHT_HEAVY = 900,
0142   PANGO_WEIGHT_ULTRAHEAVY = 1000
0143 } PangoWeight;
0144 
0145 /**
0146  * PangoStretch:
0147  * @PANGO_STRETCH_ULTRA_CONDENSED: ultra condensed width
0148  * @PANGO_STRETCH_EXTRA_CONDENSED: extra condensed width
0149  * @PANGO_STRETCH_CONDENSED: condensed width
0150  * @PANGO_STRETCH_SEMI_CONDENSED: semi condensed width
0151  * @PANGO_STRETCH_NORMAL: the normal width
0152  * @PANGO_STRETCH_SEMI_EXPANDED: semi expanded width
0153  * @PANGO_STRETCH_EXPANDED: expanded width
0154  * @PANGO_STRETCH_EXTRA_EXPANDED: extra expanded width
0155  * @PANGO_STRETCH_ULTRA_EXPANDED: ultra expanded width
0156  *
0157  * An enumeration specifying the width of the font relative to other designs
0158  * within a family.
0159  */
0160 typedef enum {
0161   PANGO_STRETCH_ULTRA_CONDENSED,
0162   PANGO_STRETCH_EXTRA_CONDENSED,
0163   PANGO_STRETCH_CONDENSED,
0164   PANGO_STRETCH_SEMI_CONDENSED,
0165   PANGO_STRETCH_NORMAL,
0166   PANGO_STRETCH_SEMI_EXPANDED,
0167   PANGO_STRETCH_EXPANDED,
0168   PANGO_STRETCH_EXTRA_EXPANDED,
0169   PANGO_STRETCH_ULTRA_EXPANDED
0170 } PangoStretch;
0171 
0172 /**
0173  * PangoFontMask:
0174  * @PANGO_FONT_MASK_FAMILY: the font family is specified.
0175  * @PANGO_FONT_MASK_STYLE: the font style is specified.
0176  * @PANGO_FONT_MASK_VARIANT: the font variant is specified.
0177  * @PANGO_FONT_MASK_WEIGHT: the font weight is specified.
0178  * @PANGO_FONT_MASK_STRETCH: the font stretch is specified.
0179  * @PANGO_FONT_MASK_SIZE: the font size is specified.
0180  * @PANGO_FONT_MASK_GRAVITY: the font gravity is specified (Since: 1.16.)
0181  * @PANGO_FONT_MASK_VARIATIONS: OpenType font variations are specified (Since: 1.42)
0182  *
0183  * The bits in a `PangoFontMask` correspond to the set fields in a
0184  * `PangoFontDescription`.
0185  */
0186 typedef enum {
0187   PANGO_FONT_MASK_FAMILY  = 1 << 0,
0188   PANGO_FONT_MASK_STYLE   = 1 << 1,
0189   PANGO_FONT_MASK_VARIANT = 1 << 2,
0190   PANGO_FONT_MASK_WEIGHT  = 1 << 3,
0191   PANGO_FONT_MASK_STRETCH = 1 << 4,
0192   PANGO_FONT_MASK_SIZE    = 1 << 5,
0193   PANGO_FONT_MASK_GRAVITY = 1 << 6,
0194   PANGO_FONT_MASK_VARIATIONS = 1 << 7,
0195 } PangoFontMask;
0196 
0197 /* CSS scale factors (1.2 factor between each size) */
0198 /**
0199  * PANGO_SCALE_XX_SMALL:
0200  *
0201  * The scale factor for three shrinking steps (1 / (1.2 * 1.2 * 1.2)).
0202  */
0203 /**
0204  * PANGO_SCALE_X_SMALL:
0205  *
0206  * The scale factor for two shrinking steps (1 / (1.2 * 1.2)).
0207  */
0208 /**
0209  * PANGO_SCALE_SMALL:
0210  *
0211  * The scale factor for one shrinking step (1 / 1.2).
0212  */
0213 /**
0214  * PANGO_SCALE_MEDIUM:
0215  *
0216  * The scale factor for normal size (1.0).
0217  */
0218 /**
0219  * PANGO_SCALE_LARGE:
0220  *
0221  * The scale factor for one magnification step (1.2).
0222  */
0223 /**
0224  * PANGO_SCALE_X_LARGE:
0225  *
0226  * The scale factor for two magnification steps (1.2 * 1.2).
0227  */
0228 /**
0229  * PANGO_SCALE_XX_LARGE:
0230  *
0231  * The scale factor for three magnification steps (1.2 * 1.2 * 1.2).
0232  */
0233 #define PANGO_SCALE_XX_SMALL ((double)0.5787037037037)
0234 #define PANGO_SCALE_X_SMALL  ((double)0.6944444444444)
0235 #define PANGO_SCALE_SMALL    ((double)0.8333333333333)
0236 #define PANGO_SCALE_MEDIUM   ((double)1.0)
0237 #define PANGO_SCALE_LARGE    ((double)1.2)
0238 #define PANGO_SCALE_X_LARGE  ((double)1.44)
0239 #define PANGO_SCALE_XX_LARGE ((double)1.728)
0240 
0241 /*
0242  * PangoFontDescription
0243  */
0244 
0245 #define PANGO_TYPE_FONT_DESCRIPTION (pango_font_description_get_type ())
0246 
0247 PANGO_AVAILABLE_IN_ALL
0248 GType                 pango_font_description_get_type    (void) G_GNUC_CONST;
0249 PANGO_AVAILABLE_IN_ALL
0250 PangoFontDescription *pango_font_description_new         (void);
0251 PANGO_AVAILABLE_IN_ALL
0252 PangoFontDescription *pango_font_description_copy        (const PangoFontDescription  *desc);
0253 PANGO_AVAILABLE_IN_ALL
0254 PangoFontDescription *pango_font_description_copy_static (const PangoFontDescription  *desc);
0255 PANGO_AVAILABLE_IN_ALL
0256 guint                 pango_font_description_hash        (const PangoFontDescription  *desc) G_GNUC_PURE;
0257 PANGO_AVAILABLE_IN_ALL
0258 gboolean              pango_font_description_equal       (const PangoFontDescription  *desc1,
0259                                                           const PangoFontDescription  *desc2) G_GNUC_PURE;
0260 PANGO_AVAILABLE_IN_ALL
0261 void                  pango_font_description_free        (PangoFontDescription        *desc);
0262 PANGO_AVAILABLE_IN_ALL
0263 void                  pango_font_descriptions_free       (PangoFontDescription       **descs,
0264                                                           int                          n_descs);
0265 
0266 PANGO_AVAILABLE_IN_ALL
0267 void                 pango_font_description_set_family        (PangoFontDescription *desc,
0268                                                                const char           *family);
0269 PANGO_AVAILABLE_IN_ALL
0270 void                 pango_font_description_set_family_static (PangoFontDescription *desc,
0271                                                                const char           *family);
0272 PANGO_AVAILABLE_IN_ALL
0273 const char          *pango_font_description_get_family        (const PangoFontDescription *desc) G_GNUC_PURE;
0274 PANGO_AVAILABLE_IN_ALL
0275 void                 pango_font_description_set_style         (PangoFontDescription *desc,
0276                                                                PangoStyle            style);
0277 PANGO_AVAILABLE_IN_ALL
0278 PangoStyle           pango_font_description_get_style         (const PangoFontDescription *desc) G_GNUC_PURE;
0279 PANGO_AVAILABLE_IN_ALL
0280 void                 pango_font_description_set_variant       (PangoFontDescription *desc,
0281                                                                PangoVariant          variant);
0282 PANGO_AVAILABLE_IN_ALL
0283 PangoVariant         pango_font_description_get_variant       (const PangoFontDescription *desc) G_GNUC_PURE;
0284 PANGO_AVAILABLE_IN_ALL
0285 void                 pango_font_description_set_weight        (PangoFontDescription *desc,
0286                                                                PangoWeight           weight);
0287 PANGO_AVAILABLE_IN_ALL
0288 PangoWeight          pango_font_description_get_weight        (const PangoFontDescription *desc) G_GNUC_PURE;
0289 PANGO_AVAILABLE_IN_ALL
0290 void                 pango_font_description_set_stretch       (PangoFontDescription *desc,
0291                                                                PangoStretch          stretch);
0292 PANGO_AVAILABLE_IN_ALL
0293 PangoStretch         pango_font_description_get_stretch       (const PangoFontDescription *desc) G_GNUC_PURE;
0294 PANGO_AVAILABLE_IN_ALL
0295 void                 pango_font_description_set_size          (PangoFontDescription *desc,
0296                                                                gint                  size);
0297 PANGO_AVAILABLE_IN_ALL
0298 gint                 pango_font_description_get_size          (const PangoFontDescription *desc) G_GNUC_PURE;
0299 PANGO_AVAILABLE_IN_1_8
0300 void                 pango_font_description_set_absolute_size (PangoFontDescription *desc,
0301                                                                double                size);
0302 PANGO_AVAILABLE_IN_1_8
0303 gboolean             pango_font_description_get_size_is_absolute (const PangoFontDescription *desc) G_GNUC_PURE;
0304 PANGO_AVAILABLE_IN_1_16
0305 void                 pango_font_description_set_gravity       (PangoFontDescription *desc,
0306                                                                PangoGravity          gravity);
0307 PANGO_AVAILABLE_IN_1_16
0308 PangoGravity         pango_font_description_get_gravity       (const PangoFontDescription *desc) G_GNUC_PURE;
0309 
0310 PANGO_AVAILABLE_IN_1_42
0311 void                 pango_font_description_set_variations_static (PangoFontDescription       *desc,
0312                                                                    const char                 *variations);
0313 PANGO_AVAILABLE_IN_1_42
0314 void                 pango_font_description_set_variations    (PangoFontDescription       *desc,
0315                                                                const char                 *variations);
0316 PANGO_AVAILABLE_IN_1_42
0317 const char          *pango_font_description_get_variations    (const PangoFontDescription *desc) G_GNUC_PURE;
0318 
0319 PANGO_AVAILABLE_IN_ALL
0320 PangoFontMask pango_font_description_get_set_fields (const PangoFontDescription *desc) G_GNUC_PURE;
0321 PANGO_AVAILABLE_IN_ALL
0322 void          pango_font_description_unset_fields   (PangoFontDescription       *desc,
0323                                                      PangoFontMask               to_unset);
0324 
0325 PANGO_AVAILABLE_IN_ALL
0326 void pango_font_description_merge        (PangoFontDescription       *desc,
0327                                           const PangoFontDescription *desc_to_merge,
0328                                           gboolean                    replace_existing);
0329 PANGO_AVAILABLE_IN_ALL
0330 void pango_font_description_merge_static (PangoFontDescription       *desc,
0331                                           const PangoFontDescription *desc_to_merge,
0332                                           gboolean                    replace_existing);
0333 
0334 PANGO_AVAILABLE_IN_ALL
0335 gboolean pango_font_description_better_match (const PangoFontDescription *desc,
0336                                               const PangoFontDescription *old_match,
0337                                               const PangoFontDescription *new_match) G_GNUC_PURE;
0338 
0339 PANGO_AVAILABLE_IN_ALL
0340 PangoFontDescription *pango_font_description_from_string (const char                  *str);
0341 PANGO_AVAILABLE_IN_ALL
0342 char *                pango_font_description_to_string   (const PangoFontDescription  *desc);
0343 PANGO_AVAILABLE_IN_ALL
0344 char *                pango_font_description_to_filename (const PangoFontDescription  *desc);
0345 
0346 /*
0347  * PangoFontMetrics
0348  */
0349 
0350 #define PANGO_TYPE_FONT_METRICS  (pango_font_metrics_get_type ())
0351 
0352 struct _PangoFontMetrics
0353 {
0354   /* <private> */
0355   guint ref_count;
0356 
0357   int ascent;
0358   int descent;
0359   int height;
0360   int approximate_char_width;
0361   int approximate_digit_width;
0362   int underline_position;
0363   int underline_thickness;
0364   int strikethrough_position;
0365   int strikethrough_thickness;
0366 };
0367 
0368 PANGO_AVAILABLE_IN_ALL
0369 GType             pango_font_metrics_get_type                    (void) G_GNUC_CONST;
0370 PANGO_AVAILABLE_IN_ALL
0371 PangoFontMetrics *pango_font_metrics_ref                         (PangoFontMetrics *metrics);
0372 PANGO_AVAILABLE_IN_ALL
0373 void              pango_font_metrics_unref                       (PangoFontMetrics *metrics);
0374 PANGO_AVAILABLE_IN_ALL
0375 int               pango_font_metrics_get_ascent                  (PangoFontMetrics *metrics) G_GNUC_PURE;
0376 PANGO_AVAILABLE_IN_ALL
0377 int               pango_font_metrics_get_descent                 (PangoFontMetrics *metrics) G_GNUC_PURE;
0378 PANGO_AVAILABLE_IN_1_44
0379 int               pango_font_metrics_get_height                  (PangoFontMetrics *metrics) G_GNUC_PURE;
0380 PANGO_AVAILABLE_IN_ALL
0381 int               pango_font_metrics_get_approximate_char_width  (PangoFontMetrics *metrics) G_GNUC_PURE;
0382 PANGO_AVAILABLE_IN_ALL
0383 int               pango_font_metrics_get_approximate_digit_width (PangoFontMetrics *metrics) G_GNUC_PURE;
0384 PANGO_AVAILABLE_IN_1_6
0385 int               pango_font_metrics_get_underline_position      (PangoFontMetrics *metrics) G_GNUC_PURE;
0386 PANGO_AVAILABLE_IN_1_6
0387 int               pango_font_metrics_get_underline_thickness     (PangoFontMetrics *metrics) G_GNUC_PURE;
0388 PANGO_AVAILABLE_IN_1_6
0389 int               pango_font_metrics_get_strikethrough_position  (PangoFontMetrics *metrics) G_GNUC_PURE;
0390 PANGO_AVAILABLE_IN_1_6
0391 int               pango_font_metrics_get_strikethrough_thickness (PangoFontMetrics *metrics) G_GNUC_PURE;
0392 
0393 
0394 /*
0395  * PangoFontFamily
0396  */
0397 
0398 #define PANGO_TYPE_FONT_FAMILY              (pango_font_family_get_type ())
0399 #define PANGO_FONT_FAMILY(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FAMILY, PangoFontFamily))
0400 #define PANGO_IS_FONT_FAMILY(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FAMILY))
0401 #define PANGO_FONT_FAMILY_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_FAMILY, PangoFontFamilyClass))
0402 #define PANGO_IS_FONT_FAMILY_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_FAMILY))
0403 #define PANGO_FONT_FAMILY_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_FAMILY, PangoFontFamilyClass))
0404 
0405 typedef struct _PangoFontFace        PangoFontFace;
0406 typedef struct _PangoFontFamily      PangoFontFamily;
0407 typedef struct _PangoFontFamilyClass PangoFontFamilyClass;
0408 
0409 #ifndef PANGO_DISABLE_DEPRECATED
0410 
0411 /**
0412  * PangoFontFamily:
0413  *
0414  * A `PangoFontFamily` is used to represent a family of related
0415  * font faces.
0416  *
0417  * The font faces in a family share a common design, but differ in
0418  * slant, weight, width or other aspects.
0419  */
0420 struct _PangoFontFamily
0421 {
0422   GObject parent_instance;
0423 };
0424 
0425 struct _PangoFontFamilyClass
0426 {
0427   GObjectClass parent_class;
0428 
0429   /*< public >*/
0430 
0431   void  (*list_faces)      (PangoFontFamily  *family,
0432                             PangoFontFace  ***faces,
0433                             int              *n_faces);
0434   const char * (*get_name) (PangoFontFamily  *family);
0435   gboolean (*is_monospace) (PangoFontFamily *family);
0436   gboolean (*is_variable)  (PangoFontFamily *family);
0437 
0438   PangoFontFace * (*get_face) (PangoFontFamily *family,
0439                                const char      *name);
0440 
0441 
0442   /*< private >*/
0443 
0444   /* Padding for future expansion */
0445   void (*_pango_reserved2) (void);
0446 };
0447 
0448 #endif /* PANGO_DISABLE_DEPRECATED */
0449 
0450 PANGO_AVAILABLE_IN_ALL
0451 GType      pango_font_family_get_type       (void) G_GNUC_CONST;
0452 
0453 PANGO_AVAILABLE_IN_ALL
0454 void                 pango_font_family_list_faces (PangoFontFamily  *family,
0455                                                    PangoFontFace  ***faces,
0456                                                    int              *n_faces);
0457 PANGO_AVAILABLE_IN_ALL
0458 const char *pango_font_family_get_name   (PangoFontFamily  *family) G_GNUC_PURE;
0459 PANGO_AVAILABLE_IN_1_4
0460 gboolean   pango_font_family_is_monospace         (PangoFontFamily  *family) G_GNUC_PURE;
0461 PANGO_AVAILABLE_IN_1_44
0462 gboolean   pango_font_family_is_variable          (PangoFontFamily  *family) G_GNUC_PURE;
0463 
0464 PANGO_AVAILABLE_IN_1_46
0465 PangoFontFace *pango_font_family_get_face (PangoFontFamily *family,
0466                                            const char      *name);
0467 
0468 
0469 /*
0470  * PangoFontFace
0471  */
0472 
0473 #define PANGO_TYPE_FONT_FACE              (pango_font_face_get_type ())
0474 #define PANGO_FONT_FACE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FACE, PangoFontFace))
0475 #define PANGO_IS_FONT_FACE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FACE))
0476 #define PANGO_FONT_FACE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_FACE, PangoFontFaceClass))
0477 #define PANGO_IS_FONT_FACE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_FACE))
0478 #define PANGO_FONT_FACE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_FACE, PangoFontFaceClass))
0479 
0480 typedef struct _PangoFontFaceClass   PangoFontFaceClass;
0481 
0482 #ifndef PANGO_DISABLE_DEPRECATED
0483 
0484 /**
0485  * PangoFontFace:
0486  *
0487  * A `PangoFontFace` is used to represent a group of fonts with
0488  * the same family, slant, weight, and width, but varying sizes.
0489  */
0490 struct _PangoFontFace
0491 {
0492   GObject parent_instance;
0493 };
0494 
0495 struct _PangoFontFaceClass
0496 {
0497   GObjectClass parent_class;
0498 
0499   /*< public >*/
0500 
0501   const char           * (*get_face_name)  (PangoFontFace *face);
0502   PangoFontDescription * (*describe)       (PangoFontFace *face);
0503   void                   (*list_sizes)     (PangoFontFace  *face,
0504                                             int           **sizes,
0505                                             int            *n_sizes);
0506   gboolean               (*is_synthesized) (PangoFontFace *face);
0507   PangoFontFamily *      (*get_family)     (PangoFontFace *face);
0508 
0509   /*< private >*/
0510 
0511   /* Padding for future expansion */
0512   void (*_pango_reserved3) (void);
0513   void (*_pango_reserved4) (void);
0514 };
0515 
0516 #endif /* PANGO_DISABLE_DEPRECATED */
0517 
0518 PANGO_AVAILABLE_IN_ALL
0519 GType      pango_font_face_get_type       (void) G_GNUC_CONST;
0520 
0521 PANGO_AVAILABLE_IN_ALL
0522 PangoFontDescription *pango_font_face_describe       (PangoFontFace  *face);
0523 PANGO_AVAILABLE_IN_ALL
0524 const char           *pango_font_face_get_face_name  (PangoFontFace  *face) G_GNUC_PURE;
0525 PANGO_AVAILABLE_IN_1_4
0526 void                  pango_font_face_list_sizes     (PangoFontFace  *face,
0527                                                       int           **sizes,
0528                                                       int            *n_sizes);
0529 PANGO_AVAILABLE_IN_1_18
0530 gboolean              pango_font_face_is_synthesized (PangoFontFace  *face) G_GNUC_PURE;
0531 
0532 PANGO_AVAILABLE_IN_1_46
0533 PangoFontFamily *     pango_font_face_get_family     (PangoFontFace  *face);
0534 
0535 
0536 /*
0537  * PangoFont
0538  */
0539 
0540 #define PANGO_TYPE_FONT              (pango_font_get_type ())
0541 #define PANGO_FONT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT, PangoFont))
0542 #define PANGO_IS_FONT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT))
0543 #define PANGO_FONT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT, PangoFontClass))
0544 #define PANGO_IS_FONT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT))
0545 #define PANGO_FONT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT, PangoFontClass))
0546 
0547 
0548 #ifndef PANGO_DISABLE_DEPRECATED
0549 
0550 /**
0551  * PangoFont:
0552  *
0553  * A `PangoFont` is used to represent a font in a
0554  * rendering-system-independent manner.
0555  */
0556 struct _PangoFont
0557 {
0558   GObject parent_instance;
0559 };
0560 
0561 typedef struct _PangoFontClass       PangoFontClass;
0562 struct _PangoFontClass
0563 {
0564   GObjectClass parent_class;
0565 
0566   /*< public >*/
0567 
0568   PangoFontDescription *(*describe)           (PangoFont      *font);
0569   PangoCoverage *       (*get_coverage)       (PangoFont      *font,
0570                                                PangoLanguage  *language);
0571   void                  (*get_glyph_extents)  (PangoFont      *font,
0572                                                PangoGlyph      glyph,
0573                                                PangoRectangle *ink_rect,
0574                                                PangoRectangle *logical_rect);
0575   PangoFontMetrics *    (*get_metrics)        (PangoFont      *font,
0576                                                PangoLanguage  *language);
0577   PangoFontMap *        (*get_font_map)       (PangoFont      *font);
0578   PangoFontDescription *(*describe_absolute)  (PangoFont      *font);
0579   void                  (*get_features)       (PangoFont      *font,
0580                                                hb_feature_t   *features,
0581                                                guint           len,
0582                                                guint          *num_features);
0583   hb_font_t *           (*create_hb_font)     (PangoFont      *font);
0584 };
0585 
0586 #endif /* PANGO_DISABLE_DEPRECATED */
0587 
0588 PANGO_AVAILABLE_IN_ALL
0589 GType                 pango_font_get_type          (void) G_GNUC_CONST;
0590 
0591 PANGO_AVAILABLE_IN_ALL
0592 PangoFontDescription *pango_font_describe          (PangoFont        *font);
0593 PANGO_AVAILABLE_IN_1_14
0594 PangoFontDescription *pango_font_describe_with_absolute_size (PangoFont        *font);
0595 PANGO_AVAILABLE_IN_ALL
0596 PangoCoverage *       pango_font_get_coverage      (PangoFont        *font,
0597                                                     PangoLanguage    *language);
0598 #ifndef __GI_SCANNER__
0599 PANGO_DEPRECATED_IN_1_44
0600 PangoEngineShape *    pango_font_find_shaper       (PangoFont        *font,
0601                                                     PangoLanguage    *language,
0602                                                     guint32           ch);
0603 #endif
0604 PANGO_AVAILABLE_IN_ALL
0605 PangoFontMetrics *    pango_font_get_metrics       (PangoFont        *font,
0606                                                     PangoLanguage    *language);
0607 PANGO_AVAILABLE_IN_ALL
0608 void                  pango_font_get_glyph_extents (PangoFont        *font,
0609                                                     PangoGlyph        glyph,
0610                                                     PangoRectangle   *ink_rect,
0611                                                     PangoRectangle   *logical_rect);
0612 PANGO_AVAILABLE_IN_1_10
0613 PangoFontMap         *pango_font_get_font_map      (PangoFont        *font);
0614 
0615 PANGO_AVAILABLE_IN_1_46
0616 PangoFontFace *       pango_font_get_face          (PangoFont        *font);
0617 
0618 PANGO_AVAILABLE_IN_1_44
0619 gboolean              pango_font_has_char          (PangoFont        *font,
0620                                                     gunichar          wc);
0621 PANGO_AVAILABLE_IN_1_44
0622 void                  pango_font_get_features      (PangoFont        *font,
0623                                                     hb_feature_t     *features,
0624                                                     guint             len,
0625                                                     guint            *num_features);
0626 PANGO_AVAILABLE_IN_1_44
0627 hb_font_t *           pango_font_get_hb_font       (PangoFont        *font);
0628 
0629 PANGO_AVAILABLE_IN_1_50
0630 PangoLanguage **      pango_font_get_languages     (PangoFont        *font);
0631 
0632 PANGO_AVAILABLE_IN_1_50
0633 GBytes *              pango_font_serialize         (PangoFont        *font);
0634 
0635 PANGO_AVAILABLE_IN_1_50
0636 PangoFont *           pango_font_deserialize       (PangoContext     *context,
0637                                                     GBytes           *bytes,
0638                                                     GError          **error);
0639 
0640 /**
0641  * PANGO_GLYPH_EMPTY:
0642  *
0643  * A `PangoGlyph` value that indicates a zero-width empty glpyh.
0644  *
0645  * This is useful for example in shaper modules, to use as the glyph for
0646  * various zero-width Unicode characters (those passing [func@is_zero_width]).
0647  */
0648 
0649 /**
0650  * PANGO_GLYPH_INVALID_INPUT:
0651  *
0652  * A `PangoGlyph` value for invalid input.
0653  *
0654  * `PangoLayout` produces one such glyph per invalid input UTF-8 byte and such
0655  * a glyph is rendered as a crossed box.
0656  *
0657  * Note that this value is defined such that it has the %PANGO_GLYPH_UNKNOWN_FLAG
0658  * set.
0659  *
0660  * Since: 1.20
0661  */
0662 /**
0663  * PANGO_GLYPH_UNKNOWN_FLAG:
0664  *
0665  * Flag used in `PangoGlyph` to turn a `gunichar` value of a valid Unicode
0666  * character into an unknown-character glyph for that `gunichar`.
0667  *
0668  * Such unknown-character glyphs may be rendered as a 'hex box'.
0669  */
0670 /**
0671  * PANGO_GET_UNKNOWN_GLYPH:
0672  * @wc: a Unicode character
0673  *
0674  * The way this unknown glyphs are rendered is backend specific. For example,
0675  * a box with the hexadecimal Unicode code-point of the character written in it
0676  * is what is done in the most common backends.
0677  *
0678  * Returns: a `PangoGlyph` value that means no glyph was found for @wc.
0679  */
0680 #define PANGO_GLYPH_EMPTY           ((PangoGlyph)0x0FFFFFFF)
0681 #define PANGO_GLYPH_INVALID_INPUT   ((PangoGlyph)0xFFFFFFFF)
0682 #define PANGO_GLYPH_UNKNOWN_FLAG    ((PangoGlyph)0x10000000)
0683 #define PANGO_GET_UNKNOWN_GLYPH(wc) ((PangoGlyph)(wc)|PANGO_GLYPH_UNKNOWN_FLAG)
0684 
0685 #ifndef __GI_SCANNER__
0686 #ifndef PANGO_DISABLE_DEPRECATED
0687 #define PANGO_UNKNOWN_GLYPH_WIDTH  10
0688 #define PANGO_UNKNOWN_GLYPH_HEIGHT 14
0689 #endif
0690 #endif
0691 
0692 G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoFontFamily, g_object_unref)
0693 G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoFontFace, g_object_unref)
0694 G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoFont, g_object_unref)
0695 G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoFontDescription, pango_font_description_free)
0696 
0697 G_END_DECLS
0698 
0699 #endif /* __PANGO_FONT_H__ */