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_PRIVATE_H__
23#define __PANGO_FONT_PRIVATE_H__
24
25#include <pango/pango-font.h>
26#include <pango/pango-coverage.h>
27#include <pango/pango-types.h>
28
29#include <glib-object.h>
30
31G_BEGIN_DECLS
32
33PANGO_AVAILABLE_IN_ALL
34PangoFontMetrics *pango_font_metrics_new (void);
35
36typedef struct {
37 PangoLanguage ** (* get_languages) (PangoFont *font);
38
39 gboolean (* is_hinted) (PangoFont *font);
40
41 void (* get_scale_factors) (PangoFont *font,
42 double *x_scale,
43 double *y_scale);
44
45 gboolean (* has_char) (PangoFont *font,
46 gunichar wc);
47 PangoFontFace * (* get_face) (PangoFont *font);
48 void (* get_matrix) (PangoFont *font,
49 PangoMatrix *matrix);
50 int (* get_absolute_size) (PangoFont *font);
51 PangoVariant (* get_variant) (PangoFont *font);
52} PangoFontClassPrivate;
53
54gboolean pango_font_is_hinted (PangoFont *font);
55void pango_font_get_scale_factors (PangoFont *font,
56 double *x_scale,
57 double *y_scale);
58void pango_font_get_matrix (PangoFont *font,
59 PangoMatrix *matrix);
60
61static inline int pango_font_get_absolute_size (PangoFont *font)
62{
63 GTypeClass *klass = (GTypeClass *) PANGO_FONT_GET_CLASS (font);
64 PangoFontClassPrivate *priv = g_type_class_get_private (klass, PANGO_TYPE_FONT);
65 return priv->get_absolute_size (font);
66}
67
68static inline PangoVariant
69pango_font_get_variant (PangoFont *font)
70{
71 GTypeClass *klass = (GTypeClass *) PANGO_FONT_GET_CLASS (font);
72 PangoFontClassPrivate *priv = g_type_class_get_private (klass, PANGO_TYPE_FONT);
73 if (priv->get_variant)
74 return priv->get_variant (font);
75 else
76 {
77 PangoFontDescription *desc;
78 PangoVariant variant;
79
80 desc = pango_font_describe (font);
81 variant = pango_font_description_get_variant (desc);
82 pango_font_description_free (desc);
83
84 return variant;
85 }
86}
87
88G_END_DECLS
89
90#endif /* __PANGO_FONT_PRIVATE_H__ */
91

source code of gtk/subprojects/pango/pango/pango-font-private.h