[pango/font-pattern-getter] fc: Add a getter for PangoFcFont::pattern




commit ecbe132ad8127a659ec86aade121a1f4356bf5cd
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Sep 21 13:56:36 2020 -0400

    fc: Add a getter for PangoFcFont::pattern
    
    Properties are better with getters.

 docs/pango-sections.txt |  1 +
 pango/pangofc-font.c    | 16 ++++++++++++++++
 pango/pangofc-font.h    |  4 ++++
 3 files changed, 21 insertions(+)
---
diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt
index 3d45510d..358f5bbf 100644
--- a/docs/pango-sections.txt
+++ b/docs/pango-sections.txt
@@ -1015,6 +1015,7 @@ pango_fc_font_get_glyph
 pango_fc_font_get_unknown_glyph
 pango_fc_font_kern_glyphs
 pango_fc_font_get_languages
+pango_fc_font_get_pattern
 <SUBSECTION Standard>
 PANGO_FC_FONT
 PANGO_IS_FC_FONT
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index 6c5492ad..01520cb4 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -1067,3 +1067,19 @@ pango_fc_font_get_languages (PangoFcFont *font)
 
   return languages;
 }
+
+/**
+ * pango_fc_font_get_pattern:
+ * @font: a #PangoFcFont
+ *
+ * Returns the FcPattern that @font is based on.
+ *
+ * Returns: the fontconfig pattern for this font
+ *
+ * Since: 1.48
+ */
+FcPattern *
+pango_fc_font_get_pattern (PangoFcFont *font)
+{
+  return font->font_pattern;
+}
diff --git a/pango/pangofc-font.h b/pango/pangofc-font.h
index aa4fd3b0..fbae5e10 100644
--- a/pango/pangofc-font.h
+++ b/pango/pangofc-font.h
@@ -98,6 +98,9 @@ PANGO_AVAILABLE_IN_1_48
 PangoLanguage **
            pango_fc_font_get_languages     (PangoFcFont      *font);
 
+PANGO_AVAILABLE_IN_1_48
+FcPattern *pango_fc_font_get_pattern       (PangoFcFont      *font);
+
 PANGO_DEPRECATED_FOR(PANGO_GET_UNKNOWN_GLYPH)
 PangoGlyph pango_fc_font_get_unknown_glyph (PangoFcFont      *font,
                                             gunichar          wc);
@@ -110,5 +113,6 @@ FT_Face    pango_fc_font_lock_face         (PangoFcFont      *font);
 PANGO_DEPRECATED_IN_1_44_FOR(pango_font_get_hb_font)
 void       pango_fc_font_unlock_face       (PangoFcFont      *font);
 
+
 G_END_DECLS
 #endif /* __PANGO_FC_FONT_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]