"Fossies" - the Fresh Open Source Software Archive

Member "pango-1.44.7/pango/pango-font.h" (25 Oct 2019, 25489 Bytes) of package /linux/misc/pango-1.44.7.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "pango-font.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.44.5_vs_1.44.6.

    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_FONT_H__
   23 #define __PANGO_FONT_H__
   24 
   25 #include <pango/pango-coverage.h>
   26 #include <pango/pango-types.h>
   27 
   28 #include <glib-object.h>
   29 #include <hb.h>
   30 
   31 G_BEGIN_DECLS
   32 
   33 /**
   34  * PangoFontDescription:
   35  *
   36  * The #PangoFontDescription structure represents the description
   37  * of an ideal font. These structures are used both to list
   38  * what fonts are available on the system and also for specifying
   39  * the characteristics of a font to load.
   40  */
   41 typedef struct _PangoFontDescription PangoFontDescription;
   42 /**
   43  * PangoFontMetrics:
   44  *
   45  * A #PangoFontMetrics structure holds the overall metric information
   46  * for a font (possibly restricted to a script). The fields of this
   47  * structure are private to implementations of a font backend. See
   48  * the documentation of the corresponding getters for documentation
   49  * of their meaning.
   50  */
   51 typedef struct _PangoFontMetrics PangoFontMetrics;
   52 
   53 /**
   54  * PangoStyle:
   55  * @PANGO_STYLE_NORMAL: the font is upright.
   56  * @PANGO_STYLE_OBLIQUE: the font is slanted, but in a roman style.
   57  * @PANGO_STYLE_ITALIC: the font is slanted in an italic style.
   58  *
   59  * An enumeration specifying the various slant styles possible for a font.
   60  **/
   61 typedef enum {
   62   PANGO_STYLE_NORMAL,
   63   PANGO_STYLE_OBLIQUE,
   64   PANGO_STYLE_ITALIC
   65 } PangoStyle;
   66 
   67 /**
   68  * PangoVariant:
   69  * @PANGO_VARIANT_NORMAL: A normal font.
   70  * @PANGO_VARIANT_SMALL_CAPS: A font with the lower case characters
   71  * replaced by smaller variants of the capital characters.
   72  *
   73  * An enumeration specifying capitalization variant of the font.
   74  */
   75 typedef enum {
   76   PANGO_VARIANT_NORMAL,
   77   PANGO_VARIANT_SMALL_CAPS
   78 } PangoVariant;
   79 
   80 /**
   81  * PangoWeight:
   82  * @PANGO_WEIGHT_THIN: the thin weight (= 100; Since: 1.24)
   83  * @PANGO_WEIGHT_ULTRALIGHT: the ultralight weight (= 200)
   84  * @PANGO_WEIGHT_LIGHT: the light weight (= 300)
   85  * @PANGO_WEIGHT_SEMILIGHT: the semilight weight (= 350; Since: 1.36.7)
   86  * @PANGO_WEIGHT_BOOK: the book weight (= 380; Since: 1.24)
   87  * @PANGO_WEIGHT_NORMAL: the default weight (= 400)
   88  * @PANGO_WEIGHT_MEDIUM: the normal weight (= 500; Since: 1.24)
   89  * @PANGO_WEIGHT_SEMIBOLD: the semibold weight (= 600)
   90  * @PANGO_WEIGHT_BOLD: the bold weight (= 700)
   91  * @PANGO_WEIGHT_ULTRABOLD: the ultrabold weight (= 800)
   92  * @PANGO_WEIGHT_HEAVY: the heavy weight (= 900)
   93  * @PANGO_WEIGHT_ULTRAHEAVY: the ultraheavy weight (= 1000; Since: 1.24)
   94  *
   95  * An enumeration specifying the weight (boldness) of a font. This is a numerical
   96  * value ranging from 100 to 1000, but there are some predefined values:
   97  */
   98 typedef enum {
   99   PANGO_WEIGHT_THIN = 100,
  100   PANGO_WEIGHT_ULTRALIGHT = 200,
  101   PANGO_WEIGHT_LIGHT = 300,
  102   PANGO_WEIGHT_SEMILIGHT = 350,
  103   PANGO_WEIGHT_BOOK = 380,
  104   PANGO_WEIGHT_NORMAL = 400,
  105   PANGO_WEIGHT_MEDIUM = 500,
  106   PANGO_WEIGHT_SEMIBOLD = 600,
  107   PANGO_WEIGHT_BOLD = 700,
  108   PANGO_WEIGHT_ULTRABOLD = 800,
  109   PANGO_WEIGHT_HEAVY = 900,
  110   PANGO_WEIGHT_ULTRAHEAVY = 1000
  111 } PangoWeight;
  112 
  113 /**
  114  * PangoStretch:
  115  * @PANGO_STRETCH_ULTRA_CONDENSED: ultra condensed width
  116  * @PANGO_STRETCH_EXTRA_CONDENSED: extra condensed width
  117  * @PANGO_STRETCH_CONDENSED: condensed width
  118  * @PANGO_STRETCH_SEMI_CONDENSED: semi condensed width
  119  * @PANGO_STRETCH_NORMAL: the normal width
  120  * @PANGO_STRETCH_SEMI_EXPANDED: semi expanded width
  121  * @PANGO_STRETCH_EXPANDED: expanded width
  122  * @PANGO_STRETCH_EXTRA_EXPANDED: extra expanded width
  123  * @PANGO_STRETCH_ULTRA_EXPANDED: ultra expanded width
  124  *
  125  * An enumeration specifying the width of the font relative to other designs
  126  * within a family.
  127  */
  128 typedef enum {
  129   PANGO_STRETCH_ULTRA_CONDENSED,
  130   PANGO_STRETCH_EXTRA_CONDENSED,
  131   PANGO_STRETCH_CONDENSED,
  132   PANGO_STRETCH_SEMI_CONDENSED,
  133   PANGO_STRETCH_NORMAL,
  134   PANGO_STRETCH_SEMI_EXPANDED,
  135   PANGO_STRETCH_EXPANDED,
  136   PANGO_STRETCH_EXTRA_EXPANDED,
  137   PANGO_STRETCH_ULTRA_EXPANDED
  138 } PangoStretch;
  139 
  140 /**
  141  * PangoFontMask:
  142  * @PANGO_FONT_MASK_FAMILY: the font family is specified.
  143  * @PANGO_FONT_MASK_STYLE: the font style is specified.
  144  * @PANGO_FONT_MASK_VARIANT: the font variant is specified.
  145  * @PANGO_FONT_MASK_WEIGHT: the font weight is specified.
  146  * @PANGO_FONT_MASK_STRETCH: the font stretch is specified.
  147  * @PANGO_FONT_MASK_SIZE: the font size is specified.
  148  * @PANGO_FONT_MASK_GRAVITY: the font gravity is specified (Since: 1.16.)
  149  * @PANGO_FONT_MASK_VARIATIONS: OpenType font variations are specified (Since: 1.42)
  150  *
  151  * The bits in a #PangoFontMask correspond to fields in a
  152  * #PangoFontDescription that have been set.
  153  */
  154 typedef enum {
  155   PANGO_FONT_MASK_FAMILY  = 1 << 0,
  156   PANGO_FONT_MASK_STYLE   = 1 << 1,
  157   PANGO_FONT_MASK_VARIANT = 1 << 2,
  158   PANGO_FONT_MASK_WEIGHT  = 1 << 3,
  159   PANGO_FONT_MASK_STRETCH = 1 << 4,
  160   PANGO_FONT_MASK_SIZE    = 1 << 5,
  161   PANGO_FONT_MASK_GRAVITY = 1 << 6,
  162   PANGO_FONT_MASK_VARIATIONS = 1 << 7,
  163 } PangoFontMask;
  164 
  165 /* CSS scale factors (1.2 factor between each size) */
  166 /**
  167  * PANGO_SCALE_XX_SMALL:
  168  *
  169  * The scale factor for three shrinking steps (1 / (1.2 * 1.2 * 1.2)).
  170  */
  171 /**
  172  * PANGO_SCALE_X_SMALL:
  173  *
  174  * The scale factor for two shrinking steps (1 / (1.2 * 1.2)).
  175  */
  176 /**
  177  * PANGO_SCALE_SMALL:
  178  *
  179  * The scale factor for one shrinking step (1 / 1.2).
  180  */
  181 /**
  182  * PANGO_SCALE_MEDIUM:
  183  *
  184  * The scale factor for normal size (1.0).
  185  */
  186 /**
  187  * PANGO_SCALE_LARGE:
  188  *
  189  * The scale factor for one magnification step (1.2).
  190  */
  191 /**
  192  * PANGO_SCALE_X_LARGE:
  193  *
  194  * The scale factor for two magnification steps (1.2 * 1.2).
  195  */
  196 /**
  197  * PANGO_SCALE_XX_LARGE:
  198  *
  199  * The scale factor for three magnification steps (1.2 * 1.2 * 1.2).
  200  */
  201 #define PANGO_SCALE_XX_SMALL ((double)0.5787037037037)
  202 #define PANGO_SCALE_X_SMALL  ((double)0.6944444444444)
  203 #define PANGO_SCALE_SMALL    ((double)0.8333333333333)
  204 #define PANGO_SCALE_MEDIUM   ((double)1.0)
  205 #define PANGO_SCALE_LARGE    ((double)1.2)
  206 #define PANGO_SCALE_X_LARGE  ((double)1.44)
  207 #define PANGO_SCALE_XX_LARGE ((double)1.728)
  208 
  209 /*
  210  * PangoFontDescription
  211  */
  212 
  213 /**
  214  * PANGO_TYPE_FONT_DESCRIPTION:
  215  *
  216  * The #GObject type for #PangoFontDescription.
  217  */
  218 #define PANGO_TYPE_FONT_DESCRIPTION (pango_font_description_get_type ())
  219 
  220 PANGO_AVAILABLE_IN_ALL
  221 GType                 pango_font_description_get_type    (void) G_GNUC_CONST;
  222 PANGO_AVAILABLE_IN_ALL
  223 PangoFontDescription *pango_font_description_new         (void);
  224 PANGO_AVAILABLE_IN_ALL
  225 PangoFontDescription *pango_font_description_copy        (const PangoFontDescription  *desc);
  226 PANGO_AVAILABLE_IN_ALL
  227 PangoFontDescription *pango_font_description_copy_static (const PangoFontDescription  *desc);
  228 PANGO_AVAILABLE_IN_ALL
  229 guint                 pango_font_description_hash        (const PangoFontDescription  *desc) G_GNUC_PURE;
  230 PANGO_AVAILABLE_IN_ALL
  231 gboolean              pango_font_description_equal       (const PangoFontDescription  *desc1,
  232                               const PangoFontDescription  *desc2) G_GNUC_PURE;
  233 PANGO_AVAILABLE_IN_ALL
  234 void                  pango_font_description_free        (PangoFontDescription        *desc);
  235 PANGO_AVAILABLE_IN_ALL
  236 void                  pango_font_descriptions_free       (PangoFontDescription       **descs,
  237                               int                          n_descs);
  238 
  239 PANGO_AVAILABLE_IN_ALL
  240 void                 pango_font_description_set_family        (PangoFontDescription *desc,
  241                                    const char           *family);
  242 PANGO_AVAILABLE_IN_ALL
  243 void                 pango_font_description_set_family_static (PangoFontDescription *desc,
  244                                    const char           *family);
  245 PANGO_AVAILABLE_IN_ALL
  246 const char          *pango_font_description_get_family        (const PangoFontDescription *desc) G_GNUC_PURE;
  247 PANGO_AVAILABLE_IN_ALL
  248 void                 pango_font_description_set_style         (PangoFontDescription *desc,
  249                                    PangoStyle            style);
  250 PANGO_AVAILABLE_IN_ALL
  251 PangoStyle           pango_font_description_get_style         (const PangoFontDescription *desc) G_GNUC_PURE;
  252 PANGO_AVAILABLE_IN_ALL
  253 void                 pango_font_description_set_variant       (PangoFontDescription *desc,
  254                                    PangoVariant          variant);
  255 PANGO_AVAILABLE_IN_ALL
  256 PangoVariant         pango_font_description_get_variant       (const PangoFontDescription *desc) G_GNUC_PURE;
  257 PANGO_AVAILABLE_IN_ALL
  258 void                 pango_font_description_set_weight        (PangoFontDescription *desc,
  259                                    PangoWeight           weight);
  260 PANGO_AVAILABLE_IN_ALL
  261 PangoWeight          pango_font_description_get_weight        (const PangoFontDescription *desc) G_GNUC_PURE;
  262 PANGO_AVAILABLE_IN_ALL
  263 void                 pango_font_description_set_stretch       (PangoFontDescription *desc,
  264                                    PangoStretch          stretch);
  265 PANGO_AVAILABLE_IN_ALL
  266 PangoStretch         pango_font_description_get_stretch       (const PangoFontDescription *desc) G_GNUC_PURE;
  267 PANGO_AVAILABLE_IN_ALL
  268 void                 pango_font_description_set_size          (PangoFontDescription *desc,
  269                                    gint                  size);
  270 PANGO_AVAILABLE_IN_ALL
  271 gint                 pango_font_description_get_size          (const PangoFontDescription *desc) G_GNUC_PURE;
  272 PANGO_AVAILABLE_IN_1_8
  273 void                 pango_font_description_set_absolute_size (PangoFontDescription *desc,
  274                                    double                size);
  275 PANGO_AVAILABLE_IN_1_8
  276 gboolean             pango_font_description_get_size_is_absolute (const PangoFontDescription *desc) G_GNUC_PURE;
  277 PANGO_AVAILABLE_IN_1_16
  278 void                 pango_font_description_set_gravity       (PangoFontDescription *desc,
  279                                    PangoGravity          gravity);
  280 PANGO_AVAILABLE_IN_1_16
  281 PangoGravity         pango_font_description_get_gravity       (const PangoFontDescription *desc) G_GNUC_PURE;
  282 
  283 PANGO_AVAILABLE_IN_1_42
  284 void                 pango_font_description_set_variations_static (PangoFontDescription       *desc,
  285                                                                    const char                 *variations);
  286 PANGO_AVAILABLE_IN_1_42
  287 void                 pango_font_description_set_variations    (PangoFontDescription       *desc,
  288                                                                const char                 *variations);
  289 PANGO_AVAILABLE_IN_1_42
  290 const char          *pango_font_description_get_variations    (const PangoFontDescription *desc) G_GNUC_PURE;
  291 
  292 PANGO_AVAILABLE_IN_ALL
  293 PangoFontMask pango_font_description_get_set_fields (const PangoFontDescription *desc) G_GNUC_PURE;
  294 PANGO_AVAILABLE_IN_ALL
  295 void          pango_font_description_unset_fields   (PangoFontDescription       *desc,
  296                              PangoFontMask               to_unset);
  297 
  298 PANGO_AVAILABLE_IN_ALL
  299 void pango_font_description_merge        (PangoFontDescription       *desc,
  300                       const PangoFontDescription *desc_to_merge,
  301                       gboolean                    replace_existing);
  302 PANGO_AVAILABLE_IN_ALL
  303 void pango_font_description_merge_static (PangoFontDescription       *desc,
  304                       const PangoFontDescription *desc_to_merge,
  305                       gboolean                    replace_existing);
  306 
  307 PANGO_AVAILABLE_IN_ALL
  308 gboolean pango_font_description_better_match (const PangoFontDescription *desc,
  309                           const PangoFontDescription *old_match,
  310                           const PangoFontDescription *new_match) G_GNUC_PURE;
  311 
  312 PANGO_AVAILABLE_IN_ALL
  313 PangoFontDescription *pango_font_description_from_string (const char                  *str);
  314 PANGO_AVAILABLE_IN_ALL
  315 char *                pango_font_description_to_string   (const PangoFontDescription  *desc);
  316 PANGO_AVAILABLE_IN_ALL
  317 char *                pango_font_description_to_filename (const PangoFontDescription  *desc);
  318 
  319 /*
  320  * PangoFontMetrics
  321  */
  322 
  323 /**
  324  * PANGO_TYPE_FONT_METRICS:
  325  *
  326  * The #GObject type for #PangoFontMetrics.
  327  */
  328 #define PANGO_TYPE_FONT_METRICS  (pango_font_metrics_get_type ())
  329 
  330 struct _PangoFontMetrics
  331 {
  332   /* <private> */
  333   guint ref_count;
  334 
  335   int ascent;
  336   int descent;
  337   int height;
  338   int approximate_char_width;
  339   int approximate_digit_width;
  340   int underline_position;
  341   int underline_thickness;
  342   int strikethrough_position;
  343   int strikethrough_thickness;
  344 };
  345 
  346 PANGO_AVAILABLE_IN_ALL
  347 GType             pango_font_metrics_get_type                    (void) G_GNUC_CONST;
  348 PANGO_AVAILABLE_IN_ALL
  349 PangoFontMetrics *pango_font_metrics_ref                         (PangoFontMetrics *metrics);
  350 PANGO_AVAILABLE_IN_ALL
  351 void              pango_font_metrics_unref                       (PangoFontMetrics *metrics);
  352 PANGO_AVAILABLE_IN_ALL
  353 int               pango_font_metrics_get_ascent                  (PangoFontMetrics *metrics) G_GNUC_PURE;
  354 PANGO_AVAILABLE_IN_ALL
  355 int               pango_font_metrics_get_descent                 (PangoFontMetrics *metrics) G_GNUC_PURE;
  356 PANGO_AVAILABLE_IN_1_44
  357 int               pango_font_metrics_get_height                  (PangoFontMetrics *metrics) G_GNUC_PURE;
  358 PANGO_AVAILABLE_IN_ALL
  359 int               pango_font_metrics_get_approximate_char_width  (PangoFontMetrics *metrics) G_GNUC_PURE;
  360 PANGO_AVAILABLE_IN_ALL
  361 int               pango_font_metrics_get_approximate_digit_width (PangoFontMetrics *metrics) G_GNUC_PURE;
  362 PANGO_AVAILABLE_IN_1_6
  363 int               pango_font_metrics_get_underline_position      (PangoFontMetrics *metrics) G_GNUC_PURE;
  364 PANGO_AVAILABLE_IN_1_6
  365 int               pango_font_metrics_get_underline_thickness     (PangoFontMetrics *metrics) G_GNUC_PURE;
  366 PANGO_AVAILABLE_IN_1_6
  367 int               pango_font_metrics_get_strikethrough_position  (PangoFontMetrics *metrics) G_GNUC_PURE;
  368 PANGO_AVAILABLE_IN_1_6
  369 int               pango_font_metrics_get_strikethrough_thickness (PangoFontMetrics *metrics) G_GNUC_PURE;
  370 
  371 
  372 /*
  373  * PangoFontFamily
  374  */
  375 
  376 /**
  377  * PANGO_TYPE_FONT_FAMILY:
  378  *
  379  * The #GObject type for #PangoFontFamily.
  380  */
  381 /**
  382  * PANGO_FONT_FAMILY:
  383  * @object: a #GObject.
  384  *
  385  * Casts a #GObject to a #PangoFontFamily.
  386  */
  387 /**
  388  * PANGO_IS_FONT_FAMILY:
  389  * @object: a #GObject.
  390  *
  391  * Returns: %TRUE if @object is a #PangoFontFamily.
  392  */
  393 #define PANGO_TYPE_FONT_FAMILY              (pango_font_family_get_type ())
  394 #define PANGO_FONT_FAMILY(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FAMILY, PangoFontFamily))
  395 #define PANGO_IS_FONT_FAMILY(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FAMILY))
  396 #define PANGO_FONT_FAMILY_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_FAMILY, PangoFontFamilyClass))
  397 #define PANGO_IS_FONT_FAMILY_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_FAMILY))
  398 #define PANGO_FONT_FAMILY_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_FAMILY, PangoFontFamilyClass))
  399 
  400 typedef struct _PangoFontFace        PangoFontFace;
  401 typedef struct _PangoFontFamily      PangoFontFamily;
  402 typedef struct _PangoFontFamilyClass PangoFontFamilyClass;
  403 
  404 #ifndef PANGO_DISABLE_DEPRECATED
  405 
  406 /**
  407  * PangoFontFamily:
  408  *
  409  * The #PangoFontFamily structure is used to represent a family of related
  410  * font faces. The faces in a family share a common design, but differ in
  411  * slant, weight, width and other aspects.
  412  */
  413 struct _PangoFontFamily
  414 {
  415   GObject parent_instance;
  416 };
  417 
  418 struct _PangoFontFamilyClass
  419 {
  420   GObjectClass parent_class;
  421 
  422   /*< public >*/
  423 
  424   void  (*list_faces)      (PangoFontFamily  *family,
  425                             PangoFontFace  ***faces,
  426                             int              *n_faces);
  427   const char * (*get_name) (PangoFontFamily  *family);
  428   gboolean (*is_monospace) (PangoFontFamily *family);
  429   gboolean (*is_variable)  (PangoFontFamily *family);
  430 
  431   /*< private >*/
  432 
  433   /* Padding for future expansion */
  434   void (*_pango_reserved2) (void);
  435   void (*_pango_reserved3) (void);
  436 };
  437 
  438 #endif /* PANGO_DISABLE_DEPRECATED */
  439 
  440 PANGO_AVAILABLE_IN_ALL
  441 GType      pango_font_family_get_type       (void) G_GNUC_CONST;
  442 
  443 PANGO_AVAILABLE_IN_ALL
  444 void                 pango_font_family_list_faces (PangoFontFamily  *family,
  445                            PangoFontFace  ***faces,
  446                            int              *n_faces);
  447 PANGO_AVAILABLE_IN_ALL
  448 const char *pango_font_family_get_name   (PangoFontFamily  *family) G_GNUC_PURE;
  449 PANGO_AVAILABLE_IN_1_4
  450 gboolean   pango_font_family_is_monospace         (PangoFontFamily  *family) G_GNUC_PURE;
  451 PANGO_AVAILABLE_IN_1_44
  452 gboolean   pango_font_family_is_variable          (PangoFontFamily  *family) G_GNUC_PURE;
  453 
  454 
  455 /*
  456  * PangoFontFace
  457  */
  458 
  459 /**
  460  * PANGO_TYPE_FONT_FACE:
  461  *
  462  * The #GObject type for #PangoFontFace.
  463  */
  464 /**
  465  * PANGO_FONT_FACE:
  466  * @object: a #GObject.
  467  *
  468  * Casts a #GObject to a #PangoFontFace.
  469  */
  470 /**
  471  * PANGO_IS_FONT_FACE:
  472  * @object: a #GObject.
  473  *
  474  * Returns: %TRUE if @object is a #PangoFontFace.
  475  */
  476 #define PANGO_TYPE_FONT_FACE              (pango_font_face_get_type ())
  477 #define PANGO_FONT_FACE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FACE, PangoFontFace))
  478 #define PANGO_IS_FONT_FACE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FACE))
  479 #define PANGO_FONT_FACE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_FACE, PangoFontFaceClass))
  480 #define PANGO_IS_FONT_FACE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_FACE))
  481 #define PANGO_FONT_FACE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_FACE, PangoFontFaceClass))
  482 
  483 typedef struct _PangoFontFaceClass   PangoFontFaceClass;
  484 
  485 #ifndef PANGO_DISABLE_DEPRECATED
  486 
  487 /**
  488  * PangoFontFace:
  489  *
  490  * The #PangoFontFace structure is used to represent a group of fonts with
  491  * the same family, slant, weight, width, but varying sizes.
  492  */
  493 struct _PangoFontFace
  494 {
  495   GObject parent_instance;
  496 };
  497 
  498 struct _PangoFontFaceClass
  499 {
  500   GObjectClass parent_class;
  501 
  502   /*< public >*/
  503 
  504   const char           * (*get_face_name)  (PangoFontFace *face);
  505   PangoFontDescription * (*describe)       (PangoFontFace *face);
  506   void                   (*list_sizes)     (PangoFontFace  *face,
  507                                             int           **sizes,
  508                                             int            *n_sizes);
  509   gboolean               (*is_synthesized) (PangoFontFace *face);
  510 
  511   /*< private >*/
  512 
  513   /* Padding for future expansion */
  514   void (*_pango_reserved3) (void);
  515   void (*_pango_reserved4) (void);
  516 };
  517 
  518 #endif /* PANGO_DISABLE_DEPRECATED */
  519 
  520 PANGO_AVAILABLE_IN_ALL
  521 GType      pango_font_face_get_type       (void) G_GNUC_CONST;
  522 
  523 PANGO_AVAILABLE_IN_ALL
  524 PangoFontDescription *pango_font_face_describe       (PangoFontFace  *face);
  525 PANGO_AVAILABLE_IN_ALL
  526 const char           *pango_font_face_get_face_name  (PangoFontFace  *face) G_GNUC_PURE;
  527 PANGO_AVAILABLE_IN_1_4
  528 void                  pango_font_face_list_sizes     (PangoFontFace  *face,
  529                               int           **sizes,
  530                               int            *n_sizes);
  531 PANGO_AVAILABLE_IN_1_18
  532 gboolean              pango_font_face_is_synthesized (PangoFontFace  *face) G_GNUC_PURE;
  533 
  534 
  535 /*
  536  * PangoFont
  537  */
  538 
  539 /**
  540  * PANGO_TYPE_FONT:
  541  *
  542  * The #GObject type for #PangoFont.
  543  */
  544 /**
  545  * PANGO_FONT:
  546  * @object: a #GObject.
  547  *
  548  * Casts a #GObject to a #PangoFont.
  549  */
  550 /**
  551  * PANGO_IS_FONT:
  552  * @object: a #GObject.
  553  *
  554  * Returns: %TRUE if @object is a #PangoFont.
  555  */
  556 #define PANGO_TYPE_FONT              (pango_font_get_type ())
  557 #define PANGO_FONT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT, PangoFont))
  558 #define PANGO_IS_FONT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT))
  559 #define PANGO_FONT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT, PangoFontClass))
  560 #define PANGO_IS_FONT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT))
  561 #define PANGO_FONT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT, PangoFontClass))
  562 
  563 
  564 #ifndef PANGO_DISABLE_DEPRECATED
  565 
  566 /**
  567  * PangoFont:
  568  *
  569  * The #PangoFont structure is used to represent
  570  * a font in a rendering-system-independent matter.
  571  * To create an implementation of a #PangoFont,
  572  * the rendering-system specific code should allocate
  573  * a larger structure that contains a nested
  574  * #PangoFont, fill in the <structfield>klass</structfield> member of
  575  * the nested #PangoFont with a pointer to
  576  * a appropriate #PangoFontClass, then call
  577  * pango_font_init() on the structure.
  578  *
  579  * The #PangoFont structure contains one member
  580  * which the implementation fills in.
  581  */
  582 struct _PangoFont
  583 {
  584   GObject parent_instance;
  585 };
  586 
  587 typedef struct _PangoFontClass       PangoFontClass;
  588 struct _PangoFontClass
  589 {
  590   GObjectClass parent_class;
  591 
  592   /*< public >*/
  593 
  594   PangoFontDescription *(*describe)           (PangoFont      *font);
  595   PangoCoverage *       (*get_coverage)       (PangoFont      *font,
  596                                                PangoLanguage  *language);
  597   void                  (*get_glyph_extents)  (PangoFont      *font,
  598                                                PangoGlyph      glyph,
  599                                                PangoRectangle *ink_rect,
  600                                                PangoRectangle *logical_rect);
  601   PangoFontMetrics *    (*get_metrics)        (PangoFont      *font,
  602                                                PangoLanguage  *language);
  603   PangoFontMap *        (*get_font_map)       (PangoFont      *font);
  604   PangoFontDescription *(*describe_absolute)  (PangoFont      *font);
  605   void                  (*get_features)       (PangoFont      *font,
  606                                                hb_feature_t   *features,
  607                                                guint           len,
  608                                                guint          *num_features);
  609   hb_font_t *           (*create_hb_font)     (PangoFont      *font);
  610 };
  611 
  612 #endif /* PANGO_DISABLE_DEPRECATED */
  613 
  614 PANGO_AVAILABLE_IN_ALL
  615 GType                 pango_font_get_type          (void) G_GNUC_CONST;
  616 
  617 PANGO_AVAILABLE_IN_ALL
  618 PangoFontDescription *pango_font_describe          (PangoFont        *font);
  619 PANGO_AVAILABLE_IN_1_14
  620 PangoFontDescription *pango_font_describe_with_absolute_size (PangoFont        *font);
  621 PANGO_AVAILABLE_IN_ALL
  622 PangoCoverage *       pango_font_get_coverage      (PangoFont        *font,
  623                             PangoLanguage    *language);
  624 PANGO_DEPRECATED_IN_1_44
  625 PangoEngineShape *    pango_font_find_shaper       (PangoFont        *font,
  626                             PangoLanguage    *language,
  627                             guint32           ch);
  628 PANGO_AVAILABLE_IN_ALL
  629 PangoFontMetrics *    pango_font_get_metrics       (PangoFont        *font,
  630                             PangoLanguage    *language);
  631 PANGO_AVAILABLE_IN_ALL
  632 void                  pango_font_get_glyph_extents (PangoFont        *font,
  633                             PangoGlyph        glyph,
  634                             PangoRectangle   *ink_rect,
  635                             PangoRectangle   *logical_rect);
  636 PANGO_AVAILABLE_IN_1_10
  637 PangoFontMap         *pango_font_get_font_map      (PangoFont        *font);
  638 
  639 PANGO_AVAILABLE_IN_1_44
  640 gboolean              pango_font_has_char          (PangoFont        *font,
  641                                                     gunichar          wc);
  642 PANGO_AVAILABLE_IN_1_44
  643 void                  pango_font_get_features      (PangoFont        *font,
  644                                                     hb_feature_t     *features,
  645                                                     guint             len,
  646                                                     guint            *num_features);
  647 PANGO_AVAILABLE_IN_1_44
  648 hb_font_t *           pango_font_get_hb_font       (PangoFont        *font);
  649 
  650 
  651 /**
  652  * PANGO_GLYPH_EMPTY:
  653  *
  654  * The %PANGO_GLYPH_EMPTY macro represents a #PangoGlyph value that has a
  655  *  special meaning, which is a zero-width empty glyph.  This is useful for
  656  * example in shaper modules, to use as the glyph for various zero-width
  657  * Unicode characters (those passing pango_is_zero_width()).
  658  */
  659 /**
  660  * PANGO_GLYPH_INVALID_INPUT:
  661  *
  662  * The %PANGO_GLYPH_INVALID_INPUT macro represents a #PangoGlyph value that has a
  663  * special meaning of invalid input.  #PangoLayout produces one such glyph
  664  * per invalid input UTF-8 byte and such a glyph is rendered as a crossed
  665  * box.
  666  *
  667  * Note that this value is defined such that it has the %PANGO_GLYPH_UNKNOWN_FLAG
  668  * on.
  669  *
  670  * Since: 1.20
  671  */
  672 /**
  673  * PANGO_GLYPH_UNKNOWN_FLAG:
  674  *
  675  * The %PANGO_GLYPH_UNKNOWN_FLAG macro is a flag value that can be added to
  676  * a #gunichar value of a valid Unicode character, to produce a #PangoGlyph
  677  * value, representing an unknown-character glyph for the respective #gunichar.
  678  */
  679 /**
  680  * PANGO_GET_UNKNOWN_GLYPH:
  681  * @wc: a Unicode character
  682  *
  683  * The way this unknown glyphs are rendered is backend specific.  For example,
  684  * a box with the hexadecimal Unicode code-point of the character written in it
  685  * is what is done in the most common backends.
  686  *
  687  * Returns: a #PangoGlyph value that means no glyph was found for @wc.
  688  */
  689 #define PANGO_GLYPH_EMPTY           ((PangoGlyph)0x0FFFFFFF)
  690 #define PANGO_GLYPH_INVALID_INPUT   ((PangoGlyph)0xFFFFFFFF)
  691 #define PANGO_GLYPH_UNKNOWN_FLAG    ((PangoGlyph)0x10000000)
  692 #define PANGO_GET_UNKNOWN_GLYPH(wc) ((PangoGlyph)(wc)|PANGO_GLYPH_UNKNOWN_FLAG)
  693 
  694 #ifndef PANGO_DISABLE_DEPRECATED
  695 #define PANGO_UNKNOWN_GLYPH_WIDTH  10
  696 #define PANGO_UNKNOWN_GLYPH_HEIGHT 14
  697 #endif
  698 
  699 G_END_DECLS
  700 
  701 #endif /* __PANGO_FONT_H__ */