summaryrefslogtreecommitdiff
path: root/pango/fonts.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-31 14:50:09 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-07-31 14:53:42 -0400
commita2e14a48b21f22db08237c20d2f9d1521417c6e3 (patch)
tree199b590a2e956892477bf65450b2c2667b348ff0 /pango/fonts.c
parent3555527ce39359e19594fc23c825e17f483f824e (diff)
downloadpango-a2e14a48b21f22db08237c20d2f9d1521417c6e3.tar.gz
Clean up rounding codeprivate-vfuncs
Add private api to get the necessary information from the font backend, and drop the hack that was added in d4356779945855f7cc.
Diffstat (limited to 'pango/fonts.c')
-rw-r--r--pango/fonts.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/pango/fonts.c b/pango/fonts.c
index 27a973f8..cd30811c 100644
--- a/pango/fonts.c
+++ b/pango/fonts.c
@@ -1713,16 +1713,33 @@ pango_font_default_get_languages (PangoFont *font)
return NULL;
}
+static gboolean
+pango_font_default_is_hinted (PangoFont *font)
+{
+ return FALSE;
+}
+
+static void
+pango_font_default_get_scale_factors (PangoFont *font,
+ double *x_scale,
+ double *y_scale)
+{
+ *x_scale = *y_scale = 1.0;
+}
+
static void
pango_font_class_init (PangoFontClass *class G_GNUC_UNUSED)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
+ PangoFontClassPrivate *pclass;
object_class->finalize = pango_font_finalize;
pclass = g_type_class_get_private ((GTypeClass *) class, PANGO_TYPE_FONT);
pclass->get_languages = pango_font_default_get_languages;
+ pclass->is_hinted = pango_font_default_is_hinted;
+ pclass->get_scale_factors = pango_font_default_get_scale_factors;
}
static void
@@ -2667,3 +2684,17 @@ pango_font_get_languages (PangoFont *font)
return pclass->get_languages (font);
}
+
+gboolean
+pango_font_is_hinted (PangoFont *font)
+{
+ return PANGO_FONT_GET_CLASS_PRIVATE (font)->is_hinted (font);
+}
+
+void
+pango_font_get_scale_factors (PangoFont *font,
+ double *x_scale,
+ double *y_scale)
+{
+ PANGO_FONT_GET_CLASS_PRIVATE (font)->get_scale_factors (font, x_scale, y_scale);
+}