summaryrefslogtreecommitdiff
path: root/pango/fonts.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-27 22:02:14 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-28 21:01:21 -0400
commit6924489203c20e5462ed19ee714c53b02393f1b0 (patch)
treeec85c0850601bc5ca56226d8d70d2d0a5ebe40d0 /pango/fonts.c
parent1d6ef80242e16c5974dddd0a92727c0e6d97407a (diff)
downloadpango-6924489203c20e5462ed19ee714c53b02393f1b0.tar.gz
font: Add a vfunc for pango_font_has_char
Diffstat (limited to 'pango/fonts.c')
-rw-r--r--pango/fonts.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/pango/fonts.c b/pango/fonts.c
index 45d05b38..f144097d 100644
--- a/pango/fonts.c
+++ b/pango/fonts.c
@@ -1727,6 +1727,16 @@ pango_font_default_get_scale_factors (PangoFont *font,
*x_scale = *y_scale = 1.0;
}
+static gboolean
+pango_font_default_has_char (PangoFont *font,
+ gunichar wc)
+{
+ PangoCoverage *coverage = pango_font_get_coverage (font, pango_language_get_default ());
+ PangoCoverageLevel result = pango_coverage_get (coverage, wc);
+ pango_coverage_unref (coverage);
+ return result != PANGO_COVERAGE_NONE;
+}
+
static void
pango_font_class_init (PangoFontClass *class G_GNUC_UNUSED)
{
@@ -1740,6 +1750,7 @@ pango_font_class_init (PangoFontClass *class G_GNUC_UNUSED)
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;
+ pclass->has_char = pango_font_default_has_char;
}
static void
@@ -2626,10 +2637,9 @@ gboolean
pango_font_has_char (PangoFont *font,
gunichar wc)
{
- PangoCoverage *coverage = pango_font_get_coverage (font, pango_language_get_default ());
- PangoCoverageLevel result = pango_coverage_get (coverage, wc);
- pango_coverage_unref (coverage);
- return result != PANGO_COVERAGE_NONE;
+ PangoFontClassPrivate *pclass = PANGO_FONT_GET_CLASS_PRIVATE (font);
+
+ return pclass->has_char (font, wc);
}
/**