From e20f81f4fa977a8d22c6afee1e46fbf46bc182d9 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 23 Nov 2018 11:57:42 -0500 Subject: [PATCH] [aat] Rename feat API a bit more --- docs/harfbuzz-sections.txt | 10 +++++----- src/hb-aat-layout-feat-table.hh | 8 ++++---- src/hb-aat-layout.cc | 32 ++++++++++++++++---------------- src/hb-aat.h | 26 +++++++++++++------------- test/api/test-aat-layout.c | 28 ++++++++++++++-------------- 5 files changed, 52 insertions(+), 52 deletions(-) diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index 221e6f04d..0498a2790 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -5,12 +5,12 @@ HB_OT_H_IN
hb-aat -hb_aat_layout_feature_get_name_id -hb_aat_layout_feature_get_selectors -hb_aat_layout_feature_selector_get_name_id -hb_aat_layout_feature_selector_t hb_aat_layout_feature_type_t -hb_aat_layout_get_features +hb_aat_layout_get_feature_types +hb_aat_layout_feature_type_get_name_id +hb_aat_layout_feature_selector_t +hb_aat_layout_feature_type_get_selectors +hb_aat_layout_feature_selector_get_name_id
diff --git a/src/hb-aat-layout-feat-table.hh b/src/hb-aat-layout-feat-table.hh index 5bb718330..d30aceefe 100644 --- a/src/hb-aat-layout-feat-table.hh +++ b/src/hb-aat-layout-feat-table.hh @@ -131,7 +131,7 @@ struct FeatureName SettingName::static_size, SettingName::cmp); - return setting ? setting->get_name_id () : HB_OT_NAME_ID_INVALID; + return setting ? setting->get_name_id () : (hb_ot_name_id_t) HB_OT_NAME_ID_INVALID; } inline bool sanitize (hb_sanitize_context_t *c, const void *base) const @@ -161,9 +161,9 @@ struct feat { static const hb_tag_t tableTag = HB_AAT_TAG_feat; - inline unsigned int get_features (unsigned int start_offset, - unsigned int *count, - hb_aat_layout_feature_type_t *features) const + inline unsigned int get_feature_types (unsigned int start_offset, + unsigned int *count, + hb_aat_layout_feature_type_t *features) const { unsigned int feature_count = featureNameCount; if (count && *count) diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc index 0ba305aaf..71bb71a45 100644 --- a/src/hb-aat-layout.cc +++ b/src/hb-aat-layout.cc @@ -301,7 +301,7 @@ _hb_aat_language_get (hb_face_t *face, } /** - * hb_aat_layout_get_features: + * hb_aat_layout_get_feature_types: * @face: a face object * @start_offset: iteration's start offset * @count: (inout): buffer size as input, filled size as output @@ -312,16 +312,16 @@ _hb_aat_language_get (hb_face_t *face, * Since: REPLACEME */ unsigned int -hb_aat_layout_get_features (hb_face_t *face, - unsigned int start_offset, - unsigned int *count, /* IN/OUT. May be NULL. */ - hb_aat_layout_feature_type_t *features /* OUT. May be NULL. */) +hb_aat_layout_get_feature_types (hb_face_t *face, + unsigned int start_offset, + unsigned int *count, /* IN/OUT. May be NULL. */ + hb_aat_layout_feature_type_t *features /* OUT. May be NULL. */) { - return face->table.feat->get_features (start_offset, count, features); + return face->table.feat->get_feature_types (start_offset, count, features); } /** - * hb_aat_layout_feature_get_name_id: + * hb_aat_layout_feature_type_get_name_id: * @face: a face object * @feature: feature id * @@ -330,12 +330,12 @@ hb_aat_layout_get_features (hb_face_t *face, * Since: REPLACEME */ hb_ot_name_id_t -hb_aat_layout_feature_get_name_id (hb_face_t *face, - hb_aat_layout_feature_type_t feature) +hb_aat_layout_feature_type_get_name_id (hb_face_t *face, + hb_aat_layout_feature_type_t feature) { return face->table.feat->get_feature_name_id (feature); } /** - * hb_aat_layout_feature_get_selectors: + * hb_aat_layout_feature_type_get_selectors: * @face: a face object * @feature: feature id * @default_selector: (out): if is set, the feature is exclusive @@ -357,12 +357,12 @@ hb_aat_layout_feature_get_name_id (hb_face_t *face, * Since: REPLACEME */ unsigned int -hb_aat_layout_feature_get_selectors (hb_face_t *face, - hb_aat_layout_feature_type_t feature, - hb_aat_layout_feature_selector_t *default_selector, /* OUT. May be NULL. */ - unsigned int start_offset, - unsigned int *count, /* IN/OUT. May be NULL. */ - hb_aat_layout_feature_selector_t *selectors /* OUT. May be NULL. */) +hb_aat_layout_feature_type_get_selectors (hb_face_t *face, + hb_aat_layout_feature_type_t feature, + hb_aat_layout_feature_selector_t *default_selector, /* OUT. May be NULL. */ + unsigned int start_offset, + unsigned int *count, /* IN/OUT. May be NULL. */ + hb_aat_layout_feature_selector_t *selectors /* OUT. May be NULL. */) { return face->table.feat->get_selectors (feature, default_selector, start_offset, count, selectors); diff --git a/src/hb-aat.h b/src/hb-aat.h index 9706470c8..26dfb5f60 100644 --- a/src/hb-aat.h +++ b/src/hb-aat.h @@ -417,26 +417,26 @@ typedef enum } hb_aat_layout_feature_selector_t; HB_EXTERN unsigned int -hb_aat_layout_get_features (hb_face_t *face, - unsigned int start_offset, - unsigned int *count, /* IN/OUT. May be NULL. */ - hb_aat_layout_feature_type_t *features /* OUT. May be NULL. */); +hb_aat_layout_get_feature_types (hb_face_t *face, + unsigned int start_offset, + unsigned int *count, /* IN/OUT. May be NULL. */ + hb_aat_layout_feature_type_t *features /* OUT. May be NULL. */); HB_EXTERN hb_ot_name_id_t -hb_aat_layout_feature_get_name_id (hb_face_t *face, - hb_aat_layout_feature_type_t feature); +hb_aat_layout_feature_type_get_name_id (hb_face_t *face, + hb_aat_layout_feature_type_t feature); HB_EXTERN unsigned int -hb_aat_layout_feature_get_selectors (hb_face_t *face, - hb_aat_layout_feature_type_t feature, - hb_aat_layout_feature_selector_t *default_selector, /* OUT. May be NULL. */ - unsigned int start_offset, - unsigned int *count, /* IN/OUT. May be NULL. */ - hb_aat_layout_feature_selector_t *settings /* OUT. May be NULL. */); +hb_aat_layout_feature_type_get_selectors (hb_face_t *face, + hb_aat_layout_feature_type_t feature, + hb_aat_layout_feature_selector_t *default_selector, /* OUT. May be NULL. */ + unsigned int start_offset, + unsigned int *count, /* IN/OUT. May be NULL. */ + hb_aat_layout_feature_selector_t *settings /* OUT. May be NULL. */); HB_EXTERN hb_ot_name_id_t -hb_aat_layout_feature_selector_get_name_id (hb_face_t *face, +hb_aat_layout_feature_selector_get_name_id (hb_face_t *face, hb_aat_layout_feature_type_t feature, hb_aat_layout_feature_selector_t selector); diff --git a/test/api/test-aat-layout.c b/test/api/test-aat-layout.c index c50494bee..8139f197d 100644 --- a/test/api/test-aat-layout.c +++ b/test/api/test-aat-layout.c @@ -34,19 +34,19 @@ static hb_face_t *face; static hb_face_t *sbix; static void -test_aat_get_features (void) +test_aat_get_feature_types (void) { hb_aat_layout_feature_type_t features[3]; unsigned int count = 3; - g_assert_cmpuint (11, ==, hb_aat_layout_get_features (face, 0, &count, features)); + g_assert_cmpuint (11, ==, hb_aat_layout_get_feature_types (face, 0, &count, features)); g_assert_cmpuint (1, ==, features[0]); g_assert_cmpuint (3, ==, features[1]); g_assert_cmpuint (6, ==, features[2]); - g_assert_cmpuint (258, ==, hb_aat_layout_feature_get_name_id (face, features[0])); - g_assert_cmpuint (261, ==, hb_aat_layout_feature_get_name_id (face, features[1])); - g_assert_cmpuint (265, ==, hb_aat_layout_feature_get_name_id (face, features[2])); + g_assert_cmpuint (258, ==, hb_aat_layout_feature_type_get_name_id (face, features[0])); + g_assert_cmpuint (261, ==, hb_aat_layout_feature_type_get_name_id (face, features[1])); + g_assert_cmpuint (265, ==, hb_aat_layout_feature_type_get_name_id (face, features[2])); } static void @@ -56,8 +56,8 @@ test_aat_get_feature_selectors (void) hb_aat_layout_feature_selector_t settings[3]; unsigned int count = 3; - g_assert_cmpuint (4, ==, hb_aat_layout_feature_get_selectors (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE, - &default_selector, 0, &count, settings)); + g_assert_cmpuint (4, ==, hb_aat_layout_feature_type_get_selectors (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE, + &default_selector, 0, &count, settings)); g_assert_cmpuint (3, ==, count); g_assert_cmpuint (0, ==, default_selector); @@ -73,8 +73,8 @@ test_aat_get_feature_selectors (void) g_assert_cmpuint (HB_OT_NAME_ID_INVALID, ==, hb_aat_layout_feature_selector_get_name_id (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE, HB_AAT_LAYOUT_SELECTOR_INVALID)); count = 3; - g_assert_cmpuint (4, ==, hb_aat_layout_feature_get_selectors (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE, - &default_selector, 3, &count, settings)); + g_assert_cmpuint (4, ==, hb_aat_layout_feature_type_get_selectors (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE, + &default_selector, 3, &count, settings)); g_assert_cmpuint (1, ==, count); g_assert_cmpuint (0, ==, default_selector); @@ -82,8 +82,8 @@ test_aat_get_feature_selectors (void) g_assert_cmpuint (297, ==, hb_aat_layout_feature_selector_get_name_id (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE, settings[0])); count = 1; - g_assert_cmpuint (1, ==, hb_aat_layout_feature_get_selectors (face, HB_AAT_LAYOUT_FEATURE_TYPE_TYPOGRAPHIC_EXTRAS, - &default_selector, 0, &count, settings)); + g_assert_cmpuint (1, ==, hb_aat_layout_feature_type_get_selectors (face, HB_AAT_LAYOUT_FEATURE_TYPE_TYPOGRAPHIC_EXTRAS, + &default_selector, 0, &count, settings)); g_assert_cmpuint (1, ==, count); g_assert_cmpuint (HB_AAT_LAYOUT_FEATURE_TYPE_INVALID, ==, default_selector); @@ -91,8 +91,8 @@ test_aat_get_feature_selectors (void) g_assert_cmpuint (308, ==, hb_aat_layout_feature_selector_get_name_id (face, HB_AAT_LAYOUT_FEATURE_TYPE_TYPOGRAPHIC_EXTRAS, settings[0])); count = 100; - g_assert_cmpuint (0, ==, hb_aat_layout_feature_get_selectors (face, HB_AAT_LAYOUT_FEATURE_TYPE_INVALID, - NULL, 0, &count, settings)); + g_assert_cmpuint (0, ==, hb_aat_layout_feature_type_get_selectors (face, HB_AAT_LAYOUT_FEATURE_TYPE_INVALID, + NULL, 0, &count, settings)); g_assert_cmpuint (0, ==, count); g_assert_cmpuint (HB_OT_NAME_ID_INVALID, ==, hb_aat_layout_feature_selector_get_name_id (sbix, HB_AAT_LAYOUT_FEATURE_TYPE_INVALID, @@ -104,7 +104,7 @@ main (int argc, char **argv) { hb_test_init (&argc, &argv); - hb_test_add (test_aat_get_features); + hb_test_add (test_aat_get_feature_types); hb_test_add (test_aat_get_feature_selectors); face = hb_test_open_font_file ("fonts/aat-feat.ttf");