[pango/kill-ft-face: 2/15] Add an api to get features of a font
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/kill-ft-face: 2/15] Add an api to get features of a font
- Date: Wed, 10 Jul 2019 11:45:45 +0000 (UTC)
commit 7e082775019b2894bdc8a02b70414bc82361ca50
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jul 9 23:08:37 2019 -0400
Add an api to get features of a font
docs/pango-sections.txt | 1 +
pango/fonts.c | 24 ++++++++++++++++++++++++
pango/pango-font-private.h | 8 ++++----
pango/pango-font.h | 5 +++++
4 files changed, 34 insertions(+), 4 deletions(-)
---
diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt
index cf0a1fd7..15bcb7b0 100644
--- a/docs/pango-sections.txt
+++ b/docs/pango-sections.txt
@@ -236,6 +236,7 @@ pango_font_get_glyph_extents
pango_font_get_metrics
pango_font_get_font_map
pango_font_get_hb_font
+pango_font_get_features
<SUBSECTION>
PangoFontFamily
PANGO_TYPE_FONT_FAMILY
diff --git a/pango/fonts.c b/pango/fonts.c
index 7d61b992..e29b02c9 100644
--- a/pango/fonts.c
+++ b/pango/fonts.c
@@ -2354,3 +2354,27 @@ pango_font_face_list_sizes (PangoFontFace *face,
*n_sizes = 0;
}
}
+
+/**
+ * pango_font_get_features:
+ * @font: a #PangoFont
+ * @features: (out caller-allocates) (array length=len): Array to features in
+ * @len: the length of @features
+ * @num_features: (inout): the number of used items in @features
+ *
+ * Obtain the OpenType features for this font.
+ *
+ * These are the features used by default for this font,
+ * unless overridden.
+ *
+ * Since: 1.44
+ */
+void
+pango_font_get_features (PangoFont *font,
+ hb_feature_t *features,
+ guint len,
+ guint *num_features)
+{
+ if (PANGO_FONT_GET_CLASS (font)->get_features)
+ PANGO_FONT_GET_CLASS (font)->get_features (font, features, len, num_features);
+}
diff --git a/pango/pango-font-private.h b/pango/pango-font-private.h
index 48ad8771..98899580 100644
--- a/pango/pango-font-private.h
+++ b/pango/pango-font-private.h
@@ -177,11 +177,11 @@ struct _PangoFontClass
PangoFontMap * (*get_font_map) (PangoFont *font);
PangoFontDescription *(*describe_absolute) (PangoFont *font);
hb_font_t * (*create_hb_font) (PangoFont *font);
+ void (*get_features) (PangoFont *font,
+ hb_feature_t *features,
+ guint len,
+ guint *num_features);
- /*< private >*/
-
- /* Padding for future expansion */
- void (*_pango_reserved1) (void);
};
/* used for very rare and miserable situtations that we cannot even
diff --git a/pango/pango-font.h b/pango/pango-font.h
index c2db5e9e..55d6dfad 100644
--- a/pango/pango-font.h
+++ b/pango/pango-font.h
@@ -487,6 +487,11 @@ PangoFontMap *pango_font_get_font_map (PangoFont *font);
PANGO_AVAILABLE_IN_1_44
hb_font_t * pango_font_get_hb_font (PangoFont *font);
+PANGO_AVAILABLE_IN_1_44
+void pango_font_get_features (PangoFont *font,
+ hb_feature_t *features,
+ guint len,
+ guint *num_features);
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]