From 1bac85828c134835ce0a3ecd517aefdcecf43d9a Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Thu, 18 Jun 2020 22:56:07 +0430 Subject: [PATCH] [layout] Rename _get_alternates to _get_glyph_alternates --- docs/harfbuzz-sections.txt | 2 +- src/hb-ot-layout-gsub-table.hh | 36 +++++++++++++++++----------------- src/hb-ot-layout.cc | 16 +++++++-------- src/hb-ot-layout.h | 12 ++++++------ test/api/test-ot-alternates.c | 6 +++--- 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index ae3038ffa..fe9b89c05 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -574,7 +574,7 @@ hb_ot_layout_language_get_feature_indexes hb_ot_layout_language_get_feature_tags hb_ot_layout_language_get_required_feature hb_ot_layout_lookup_collect_glyphs -hb_ot_layout_lookup_get_alternates +hb_ot_layout_lookup_get_glyph_alternates hb_ot_layout_lookup_substitute_closure hb_ot_layout_lookups_substitute_closure hb_ot_layout_lookup_would_substitute diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 688330856..f37676c28 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -557,9 +557,9 @@ struct AlternateSet } unsigned - get_alternates (unsigned start_offset, - unsigned *alternate_count /* IN/OUT. May be NULL. */, - hb_codepoint_t *alternate_glyphs /* OUT. May be NULL. */) const + get_glyph_alternates (unsigned start_offset, + unsigned *alternate_count /* IN/OUT. May be NULL. */, + hb_codepoint_t *alternate_glyphs /* OUT. May be NULL. */) const { if (alternate_count) { @@ -646,11 +646,11 @@ struct AlternateSubstFormat1 { return (this+coverage).get_coverage (gid); } unsigned - get_alternates (unsigned index, - unsigned start_offset, - unsigned *alternate_count /* IN/OUT. May be NULL. */, - hb_codepoint_t *alternate_glyphs /* OUT. May be NULL. */) const - { return (this+alternateSet[index]).get_alternates (start_offset, alternate_count, alternate_glyphs); } + get_glyph_alternates (unsigned index, + unsigned start_offset, + unsigned *alternate_count /* IN/OUT. May be NULL. */, + hb_codepoint_t *alternate_glyphs /* OUT. May be NULL. */) const + { return (this+alternateSet[index]).get_glyph_alternates (start_offset, alternate_count, alternate_glyphs); } bool apply (hb_ot_apply_context_t *c) const { @@ -749,13 +749,13 @@ struct AlternateSubst } unsigned - get_alternates (unsigned index, - unsigned start_offset, - unsigned *alternate_count /* IN/OUT. May be NULL. */, - hb_codepoint_t *alternate_glyphs /* OUT. May be NULL. */) const + get_glyph_alternates (unsigned index, + unsigned start_offset, + unsigned *alternate_count /* IN/OUT. May be NULL. */, + hb_codepoint_t *alternate_glyphs /* OUT. May be NULL. */) const { switch (u.format) { - case 1: return u.format1.get_alternates (index, start_offset, alternate_count, alternate_glyphs); + case 1: return u.format1.get_glyph_alternates (index, start_offset, alternate_count, alternate_glyphs); default:assert (0); return 0; } } @@ -1509,10 +1509,10 @@ struct SubstLookup : Lookup } unsigned - get_alternates (hb_codepoint_t gid, - unsigned start_offset, - unsigned *alternate_count /* IN/OUT. May be NULL. */, - hb_codepoint_t *alternate_glyphs /* OUT. May be NULL. */) const + get_glyph_alternates (hb_codepoint_t gid, + unsigned start_offset, + unsigned *alternate_count /* IN/OUT. May be NULL. */, + hb_codepoint_t *alternate_glyphs /* OUT. May be NULL. */) const { if (get_type () == SubTable::Alternate) { @@ -1522,7 +1522,7 @@ struct SubstLookup : Lookup const AlternateSubst &alternate_subtable = get_subtable (i).u.alternate; unsigned index = alternate_subtable.get_coverage_index (gid); if (index != NOT_COVERED) - return alternate_subtable.get_alternates (index, start_offset, alternate_count, alternate_glyphs); + return alternate_subtable.get_glyph_alternates (index, start_offset, alternate_count, alternate_glyphs); } } if (alternate_count) *alternate_count = 0; diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index c58b667af..82d6f0c8a 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -1971,7 +1971,7 @@ hb_ot_layout_get_baseline (hb_font_t *font, #endif /** - * hb_ot_layout_lookup_get_alternates: + * hb_ot_layout_lookup_get_glyph_alternates: * @face: a face. * @lookup_index: index of the feature lookup to query. * @glyph: a glyph id. @@ -1988,15 +1988,15 @@ hb_ot_layout_get_baseline (hb_font_t *font, * Since: REPLACEME **/ HB_EXTERN unsigned -hb_ot_layout_lookup_get_alternates (hb_face_t *face, - unsigned lookup_index, - hb_codepoint_t glyph, - unsigned start_offset, - unsigned *alternate_count /* IN/OUT. May be NULL. */, - hb_codepoint_t *alternate_glyphs /* OUT. May be NULL. */) +hb_ot_layout_lookup_get_glyph_alternates (hb_face_t *face, + unsigned lookup_index, + hb_codepoint_t glyph, + unsigned start_offset, + unsigned *alternate_count /* IN/OUT. May be NULL. */, + hb_codepoint_t *alternate_glyphs /* OUT. May be NULL. */) { const OT::SubstLookup &lookup = face->table.GSUB->table->get_lookup (lookup_index); - return lookup.get_alternates (glyph, start_offset, alternate_count, alternate_glyphs); + return lookup.get_glyph_alternates (glyph, start_offset, alternate_count, alternate_glyphs); } #endif diff --git a/src/hb-ot-layout.h b/src/hb-ot-layout.h index fedf32e1e..b23fbf4e1 100644 --- a/src/hb-ot-layout.h +++ b/src/hb-ot-layout.h @@ -450,12 +450,12 @@ hb_ot_layout_get_baseline (hb_font_t *font, hb_position_t *coord /* OUT. May be NULL. */); HB_EXTERN unsigned -hb_ot_layout_lookup_get_alternates (hb_face_t *face, - unsigned lookup_index, - hb_codepoint_t glyph, - unsigned start_offset, - unsigned *alternate_count /* IN/OUT */, - hb_codepoint_t *alternate_glyphs); +hb_ot_layout_lookup_get_glyph_alternates (hb_face_t *face, + unsigned lookup_index, + hb_codepoint_t glyph, + unsigned start_offset, + unsigned *alternate_count /* IN/OUT */, + hb_codepoint_t *alternate_glyphs); HB_END_DECLS diff --git a/test/api/test-ot-alternates.c b/test/api/test-ot-alternates.c index f91acecc1..4db6b1558 100644 --- a/test/api/test-ot-alternates.c +++ b/test/api/test-ot-alternates.c @@ -28,13 +28,13 @@ #include static void -test_ot_layout_lookup_get_alternates (void) +test_ot_layout_lookup_get_glyph_alternates (void) { hb_face_t *face = hb_test_open_font_file ("fonts/SourceSansPro-Regular.otf"); hb_codepoint_t alternates[3]; unsigned alternates_count = 3; - g_assert_cmpuint (7, ==, hb_ot_layout_lookup_get_alternates (face, 1, 1091, 2, &alternates_count, alternates)); + g_assert_cmpuint (7, ==, hb_ot_layout_lookup_get_glyph_alternates (face, 1, 1091, 2, &alternates_count, alternates)); g_assert_cmpuint (3, ==, alternates_count); g_assert_cmpuint (1606, ==, alternates[0]); @@ -48,6 +48,6 @@ int main (int argc, char **argv) { hb_test_init (&argc, &argv); - hb_test_add (test_ot_layout_lookup_get_alternates); + hb_test_add (test_ot_layout_lookup_get_glyph_alternates); return hb_test_run (); }