summaryrefslogtreecommitdiff
path: root/pango/pango-font-private.h
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-12-21 07:49:45 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-12-21 07:49:45 -0500
commitc3866592cdc45877e2fa7e0181d4c83ead059842 (patch)
tree07a9ffe88f4b6aef92ae0173fd5ff543dedbaff0 /pango/pango-font-private.h
parent092061db9d0bb94549e3ad44095fcaed49080c82 (diff)
downloadpango-c3866592cdc45877e2fa7e0181d4c83ead059842.tar.gz
Add a private api to get the font size
Add a private vfunc to get the (absolute) size of a font. This default implementation just pulls it out of the font description, but we can do implement this cheaper without copying the font description.
Diffstat (limited to 'pango/pango-font-private.h')
-rw-r--r--pango/pango-font-private.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/pango/pango-font-private.h b/pango/pango-font-private.h
index 1e38371d..885e38c1 100644
--- a/pango/pango-font-private.h
+++ b/pango/pango-font-private.h
@@ -47,6 +47,7 @@ typedef struct {
PangoFontFace * (* get_face) (PangoFont *font);
void (* get_matrix) (PangoFont *font,
PangoMatrix *matrix);
+ int (* get_absolute_size) (PangoFont *font);
} PangoFontClassPrivate;
gboolean pango_font_is_hinted (PangoFont *font);
@@ -55,7 +56,12 @@ void pango_font_get_scale_factors (PangoFont *font,
double *y_scale);
void pango_font_get_matrix (PangoFont *font,
PangoMatrix *matrix);
-
+static inline int pango_font_get_absolute_size (PangoFont *font)
+{
+ GTypeClass *klass = (GTypeClass *) PANGO_FONT_GET_CLASS (font);
+ PangoFontClassPrivate *priv = g_type_class_get_private (klass, PANGO_TYPE_FONT);
+ return priv->get_absolute_size (font);
+}
G_END_DECLS