diff options
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-ot-layout.cc')
-rw-r--r-- | thirdparty/harfbuzz/src/hb-ot-layout.cc | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/thirdparty/harfbuzz/src/hb-ot-layout.cc b/thirdparty/harfbuzz/src/hb-ot-layout.cc index 0454af2063..4e1d23eba5 100644 --- a/thirdparty/harfbuzz/src/hb-ot-layout.cc +++ b/thirdparty/harfbuzz/src/hb-ot-layout.cc @@ -613,7 +613,7 @@ hb_ot_layout_table_get_feature_tags (hb_face_t *face, * hb_ot_layout_table_find_feature: * @face: #hb_face_t to work upon * @table_tag: #HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS - * @feature_tag: The #hb_tag_t og the requested feature tag + * @feature_tag: The #hb_tag_t of the requested feature tag * @feature_index: (out): The index of the requested feature * * Fetches the index for a given feature tag in the specified face's GSUB table @@ -688,8 +688,8 @@ hb_ot_layout_script_get_language_tags (hb_face_t *face, * * Return value: %true if the language tag is found, %false otherwise * - * Since: ?? - * Deprecated: ?? + * Since: 0.6.0 + * Deprecated: 2.0.0 **/ hb_bool_t hb_ot_layout_script_find_language (hb_face_t *face, @@ -717,10 +717,14 @@ hb_ot_layout_script_find_language (hb_face_t *face, * @language_tags: The array of language tags * @language_index: (out): The index of the requested language * - * Fetches the index of a given language tag in the specified face's GSUB table - * or GPOS table, underneath the specified script index. + * Fetches the index of the first language tag fom @language_tags that is present + * in the specified face's GSUB or GPOS table, underneath the specified script + * index. * - * Return value: %true if the language tag is found, %false otherwise + * If none of the given language tags is found, %false is returned and + * @language_index is set to the default language index. + * + * Return value: %true if one of the given language tags is found, %false otherwise * * Since: 2.0.0 **/ @@ -746,7 +750,8 @@ hb_ot_layout_script_select_language (hb_face_t *face, if (s.find_lang_sys_index (HB_OT_TAG_DEFAULT_LANGUAGE, language_index)) return false; - if (language_index) *language_index = HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX; + if (language_index) + *language_index = HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX; return false; } @@ -1013,24 +1018,15 @@ struct hb_collect_features_context_t } has_feature_filter = true; + hb_set_t features_set; for (; *features; features++) - { - hb_tag_t tag = *features; - unsigned index; - g.find_feature_index (tag, &index); - if (index == OT::Index::NOT_FOUND_INDEX) continue; + features_set.add (*features); - feature_indices_filter.add(index); - for (int i = (int) index - 1; i >= 0; i--) - { - if (g.get_feature_tag (i) != tag) break; - feature_indices_filter.add(i); - } - for (unsigned i = index + 1; i < g.get_feature_count (); i++) - { - if (g.get_feature_tag (i) != tag) break; + for (unsigned i = 0; i < g.get_feature_count (); i++) + { + hb_tag_t tag = g.get_feature_tag (i); + if (features_set.has (tag)) feature_indices_filter.add(i); - } } } @@ -1497,7 +1493,7 @@ hb_ot_layout_lookup_substitute_closure (hb_face_t *face, { hb_set_t cur_intersected_glyphs; hb_map_t done_lookups_glyph_count; - hb_hashmap_t<unsigned, hb_set_t *, (unsigned)-1, nullptr> done_lookups_glyph_set; + hb_hashmap_t<unsigned, hb_set_t *> done_lookups_glyph_set; OT::hb_closure_context_t c (face, glyphs, &cur_intersected_glyphs, &done_lookups_glyph_count, &done_lookups_glyph_set); const OT::SubstLookup& l = face->table.GSUB->table->get_lookup (lookup_index); @@ -1526,7 +1522,7 @@ hb_ot_layout_lookups_substitute_closure (hb_face_t *face, { hb_set_t cur_intersected_glyphs; hb_map_t done_lookups_glyph_count; - hb_hashmap_t<unsigned, hb_set_t *, (unsigned)-1, nullptr> done_lookups_glyph_set; + hb_hashmap_t<unsigned, hb_set_t *> done_lookups_glyph_set; OT::hb_closure_context_t c (face, glyphs, &cur_intersected_glyphs, &done_lookups_glyph_count, &done_lookups_glyph_set); const OT::GSUB& gsub = *face->table.GSUB->table; @@ -2011,14 +2007,14 @@ struct hb_get_glyph_alternates_dispatch_t : private: template <typename T, typename ...Ts> auto _dispatch (const T &obj, hb_priority<1>, Ts&&... ds) HB_AUTO_RETURN - ( obj.get_glyph_alternates (hb_forward<Ts> (ds)...) ) + ( obj.get_glyph_alternates (std::forward<Ts> (ds)...) ) template <typename T, typename ...Ts> auto _dispatch (const T &obj, hb_priority<0>, Ts&&... ds) HB_AUTO_RETURN ( default_return_value () ) public: template <typename T, typename ...Ts> auto dispatch (const T &obj, Ts&&... ds) HB_AUTO_RETURN - ( _dispatch (obj, hb_prioritize, hb_forward<Ts> (ds)...) ) + ( _dispatch (obj, hb_prioritize, std::forward<Ts> (ds)...) ) }; /** |