diff options
-rw-r--r-- | docs/pango-sections.txt | 1 | ||||
-rw-r--r-- | pango/fonts.c | 21 | ||||
-rw-r--r-- | pango/pango-font-private.h | 1 | ||||
-rw-r--r-- | pango/pango-font.h | 3 |
4 files changed, 25 insertions, 1 deletions
diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt index 61823711..0fc648af 100644 --- a/docs/pango-sections.txt +++ b/docs/pango-sections.txt @@ -232,6 +232,7 @@ pango_font_find_shaper pango_font_describe pango_font_describe_with_absolute_size pango_font_get_coverage +pango_font_covers pango_font_get_glyph_extents pango_font_get_metrics pango_font_get_font_map diff --git a/pango/fonts.c b/pango/fonts.c index f273cd26..2dd39f2e 100644 --- a/pango/fonts.c +++ b/pango/fonts.c @@ -2306,3 +2306,24 @@ pango_font_face_list_sizes (PangoFontFace *face, *n_sizes = 0; } } + +/** + * pango_font_covers: + * @font: a #PangoFont + * @wc: a Unicode character + * + * Returns whether the font provides a glyph for this character. + * + * Returns %TRUE if @font can render @wc + * + * Since: 1.44 + */ +gboolean +pango_font_covers (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; +} diff --git a/pango/pango-font-private.h b/pango/pango-font-private.h index 44d19dee..5d7bb4de 100644 --- a/pango/pango-font-private.h +++ b/pango/pango-font-private.h @@ -30,7 +30,6 @@ G_BEGIN_DECLS - PANGO_AVAILABLE_IN_ALL PangoFontMetrics *pango_font_metrics_new (void); diff --git a/pango/pango-font.h b/pango/pango-font.h index ceaf9643..84d4e122 100644 --- a/pango/pango-font.h +++ b/pango/pango-font.h @@ -484,6 +484,9 @@ void pango_font_get_glyph_extents (PangoFont *font, PANGO_AVAILABLE_IN_1_10 PangoFontMap *pango_font_get_font_map (PangoFont *font); +PANGO_AVAILABLE_IN_1_44 +gboolean pango_font_covers (PangoFont *font, + gunichar unichar); /** * PANGO_GLYPH_EMPTY: |