diff --git a/src/OT/Layout/GSUB/Common.hh b/src/OT/Layout/GSUB/Common.hh index 968bba048..b849494d8 100644 --- a/src/OT/Layout/GSUB/Common.hh +++ b/src/OT/Layout/GSUB/Common.hh @@ -8,8 +8,6 @@ namespace OT { namespace Layout { namespace GSUB_impl { -typedef hb_pair_t hb_codepoint_pair_t; - template static void SingleSubst_serialize (hb_serialize_context_t *c, Iterator it); diff --git a/src/OT/glyf/glyf-helpers.hh b/src/OT/glyf/glyf-helpers.hh index 8fa4e6a98..e3eea7297 100644 --- a/src/OT/glyf/glyf-helpers.hh +++ b/src/OT/glyf/glyf-helpers.hh @@ -16,7 +16,7 @@ template static void _write_loca (IteratorIn&& it, - const hb_sorted_vector_t> new_to_old_gid_list, + const hb_sorted_vector_t new_to_old_gid_list, bool short_offsets, TypeOut *dest, unsigned num_offsets) @@ -82,7 +82,7 @@ template> new_to_old_gid_list, + const hb_sorted_vector_t new_to_old_gid_list, unsigned num_glyphs, bool use_short_loca) { diff --git a/src/graph/pairpos-graph.hh b/src/graph/pairpos-graph.hh index 1c13eb24f..f655b7155 100644 --- a/src/graph/pairpos-graph.hh +++ b/src/graph/pairpos-graph.hh @@ -215,7 +215,7 @@ struct PairPosFormat2 : public OT::Layout::GPOS_impl::PairPosFormat2_4iter () | hb_map_retains_sorting ([&] (hb_codepoint_t gid) { - return hb_pair_t (gid, class_def_1->get_class (gid)); + return hb_codepoint_pair_t (gid, class_def_1->get_class (gid)); }) ; class_def_size_estimator_t estimator (gid_and_class); @@ -386,14 +386,14 @@ struct PairPosFormat2 : public OT::Layout::GPOS_impl::PairPosFormat2_4iter () | hb_map_retains_sorting ([&] (hb_codepoint_t gid) { - return hb_pair_t (gid, class_def_1_table->get_class (gid)); + return hb_codepoint_pair_t (gid, class_def_1_table->get_class (gid)); }) | hb_filter ([&] (hb_codepoint_t klass) { return klass >= start && klass < end; }, hb_second) - | hb_map_retains_sorting ([&] (hb_pair_t gid_and_class) { + | hb_map_retains_sorting ([&] (hb_codepoint_pair_t gid_and_class) { // Classes must be from 0...N so subtract start - return hb_pair_t (gid_and_class.first, gid_and_class.second - start); + return hb_codepoint_pair_t (gid_and_class.first, gid_and_class.second - start); }) ; @@ -519,7 +519,7 @@ struct PairPosFormat2 : public OT::Layout::GPOS_impl::PairPosFormat2_4iter () | hb_map_retains_sorting ([&] (hb_codepoint_t gid) { - return hb_pair_t (gid, class_def_1.table->get_class (gid)); + return hb_codepoint_pair_t (gid, class_def_1.table->get_class (gid)); }) | hb_filter ([&] (hb_codepoint_t klass) { return klass < count; diff --git a/src/graph/test-classdef-graph.cc b/src/graph/test-classdef-graph.cc index 55854ff5c..266be5e2d 100644 --- a/src/graph/test-classdef-graph.cc +++ b/src/graph/test-classdef-graph.cc @@ -27,7 +27,7 @@ #include "gsubgpos-context.hh" #include "classdef-graph.hh" -typedef hb_pair_t gid_and_class_t; +typedef hb_codepoint_pair_t gid_and_class_t; typedef hb_vector_t gid_and_class_list_t; diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 221059aac..86414866f 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -662,6 +662,8 @@ struct hb_pair_t template static inline hb_pair_t hb_pair (T1&& a, T2&& b) { return hb_pair_t (a, b); } +typedef hb_pair_t hb_codepoint_pair_t; + struct { template constexpr typename Pair::first_t diff --git a/src/hb-bit-set-invertible.hh b/src/hb-bit-set-invertible.hh index 1eb1b1c20..215d924f6 100644 --- a/src/hb-bit-set-invertible.hh +++ b/src/hb-bit-set-invertible.hh @@ -136,7 +136,7 @@ struct hb_bit_set_invertible_t /* Sink interface. */ hb_bit_set_invertible_t& operator << (hb_codepoint_t v) { add (v); return *this; } - hb_bit_set_invertible_t& operator << (const hb_pair_t& range) + hb_bit_set_invertible_t& operator << (const hb_codepoint_pair_t& range) { add_range (range.first, range.second); return *this; } bool intersects (hb_codepoint_t first, hb_codepoint_t last) const @@ -162,7 +162,7 @@ struct hb_bit_set_invertible_t auto it1 = iter (); auto it2 = other.iter (); return hb_all (+ hb_zip (it1, it2) - | hb_map ([](hb_pair_t _) { return _.first == _.second; })); + | hb_map ([](hb_codepoint_pair_t _) { return _.first == _.second; })); } } diff --git a/src/hb-bit-set.hh b/src/hb-bit-set.hh index aad81e25a..c8f5846ae 100644 --- a/src/hb-bit-set.hh +++ b/src/hb-bit-set.hh @@ -346,7 +346,7 @@ struct hb_bit_set_t /* Sink interface. */ hb_bit_set_t& operator << (hb_codepoint_t v) { add (v); return *this; } - hb_bit_set_t& operator << (const hb_pair_t& range) + hb_bit_set_t& operator << (const hb_codepoint_pair_t& range) { add_range (range.first, range.second); return *this; } bool intersects (hb_codepoint_t first, hb_codepoint_t last) const diff --git a/src/hb-map.hh b/src/hb-map.hh index bc751aca7..3df495b68 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -509,7 +509,7 @@ struct hb_map_t : hb_hashmap_t> lst) : hashmap (lst) {} + hb_map_t (std::initializer_list lst) : hashmap (lst) {} template hb_map_t (const Iterable &o) : hashmap (o) {} diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index b18470d09..e4aa3075c 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -325,7 +325,7 @@ struct CmapSubtableFormat4 { auto format4_iter = + it - | hb_filter ([&] (const hb_pair_t _) + | hb_filter ([&] (const hb_codepoint_pair_t _) { return _.first <= 0xFFFF; }) ; @@ -335,7 +335,7 @@ struct CmapSubtableFormat4 if (unlikely (!c->extend_min (this))) return; this->format = 4; - hb_vector_t> cp_to_gid { + hb_vector_t cp_to_gid { format4_iter }; @@ -1805,7 +1805,7 @@ struct cmap auto it = + c->plan->unicode_to_new_gid_list.iter () - | hb_filter ([&] (const hb_pair_t _) + | hb_filter ([&] (const hb_codepoint_pair_t _) { return (_.second != HB_MAP_VALUE_INVALID); }) ; diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh index 68faadd6e..b1c48442b 100644 --- a/src/hb-ot-hmtx-table.hh +++ b/src/hb-ot-hmtx-table.hh @@ -158,7 +158,7 @@ struct hmtxvmtx hb_requires (hb_is_iterator (Iterator))> void serialize (hb_serialize_context_t *c, Iterator it, - const hb_vector_t> new_to_old_gid_list, + const hb_vector_t new_to_old_gid_list, unsigned num_long_metrics, unsigned total_num_metrics) { @@ -216,7 +216,7 @@ struct hmtxvmtx auto it = + hb_iter (c->plan->new_to_old_gid_list) - | hb_map ([c, &_mtx, mtx_map] (hb_pair_t _) + | hb_map ([c, &_mtx, mtx_map] (hb_codepoint_pair_t _) { hb_codepoint_t new_gid = _.first; hb_codepoint_t old_gid = _.second; diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index ead57b2de..7c7f9bcbf 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -55,7 +55,7 @@ static bool ClassDef_remap_and_serialize ( hb_serialize_context_t *c, const hb_set_t &klasses, bool use_class_zero, - hb_sorted_vector_t> &glyph_and_klass, /* IN/OUT */ + hb_sorted_vector_t &glyph_and_klass, /* IN/OUT */ hb_map_t *klass_map /*IN/OUT*/); struct hb_collect_feature_substitutes_with_var_context_t @@ -1485,7 +1485,7 @@ struct LookupOffsetList : List16OfOffsetTo static bool ClassDef_remap_and_serialize (hb_serialize_context_t *c, const hb_set_t &klasses, bool use_class_zero, - hb_sorted_vector_t> &glyph_and_klass, /* IN/OUT */ + hb_sorted_vector_t &glyph_and_klass, /* IN/OUT */ hb_map_t *klass_map /*IN/OUT*/) { if (!klass_map) @@ -1576,7 +1576,7 @@ struct ClassDefFormat1_3 TRACE_SUBSET (this); const hb_map_t &glyph_map = c->plan->glyph_map_gsub; - hb_sorted_vector_t> glyph_and_klass; + hb_sorted_vector_t glyph_and_klass; hb_set_t orig_klasses; hb_codepoint_t start = startGlyph; @@ -1833,7 +1833,7 @@ struct ClassDefFormat2_4 const hb_map_t &glyph_map = c->plan->glyph_map_gsub; const hb_set_t &glyph_set = *c->plan->glyphset_gsub (); - hb_sorted_vector_t> glyph_and_klass; + hb_sorted_vector_t glyph_and_klass; hb_set_t orig_klasses; if (glyph_set.get_population () * hb_bit_storage ((unsigned) rangeRecord.len) / 2 diff --git a/src/hb-set.hh b/src/hb-set.hh index 604802381..7d1c941e4 100644 --- a/src/hb-set.hh +++ b/src/hb-set.hh @@ -115,7 +115,7 @@ struct hb_sparseset_t /* Sink interface. */ hb_sparseset_t& operator << (hb_codepoint_t v) { add (v); return *this; } - hb_sparseset_t& operator << (const hb_pair_t& range) + hb_sparseset_t& operator << (const hb_codepoint_pair_t& range) { add_range (range.first, range.second); return *this; } bool intersects (hb_codepoint_t first, hb_codepoint_t last) const @@ -174,7 +174,7 @@ struct hb_set_t : hb_sparseset_t hb_set_t& operator << (hb_codepoint_t v) { sparseset::operator<< (v); return *this; } - hb_set_t& operator << (const hb_pair_t& range) + hb_set_t& operator << (const hb_codepoint_pair_t& range) { sparseset::operator<< (range); return *this; } }; diff --git a/src/hb-subset-plan-member-list.hh b/src/hb-subset-plan-member-list.hh index a28bfb12a..be29e67ec 100644 --- a/src/hb-subset-plan-member-list.hh +++ b/src/hb-subset-plan-member-list.hh @@ -33,9 +33,9 @@ // For each cp that we'd like to retain maps to the corresponding gid. HB_SUBSET_PLAN_MEMBER (hb_set_t, unicodes) -HB_SUBSET_PLAN_MEMBER (hb_sorted_vector_t E(>), unicode_to_new_gid_list) +HB_SUBSET_PLAN_MEMBER (hb_sorted_vector_t, unicode_to_new_gid_list) -HB_SUBSET_PLAN_MEMBER (hb_sorted_vector_t E(>), new_to_old_gid_list) +HB_SUBSET_PLAN_MEMBER (hb_sorted_vector_t, new_to_old_gid_list) // name_ids we would like to retain HB_SUBSET_PLAN_MEMBER (hb_set_t, name_ids) diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 38ef76da5..c85ac4945 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -772,8 +772,7 @@ _create_glyph_map_gsub (const hb_set_t* glyph_set_gsub, out->resize (glyph_set_gsub->get_population ()); + hb_iter (glyph_set_gsub) | hb_map ([&] (hb_codepoint_t gid) { - return hb_pair_t (gid, - glyph_map->get (gid)); + return hb_codepoint_pair_t (gid, glyph_map->get (gid)); }) | hb_sink (out) ; @@ -786,7 +785,7 @@ _create_old_gid_to_new_gid_map (const hb_face_t *face, const hb_map_t *requested_glyph_map, hb_map_t *glyph_map, /* OUT */ hb_map_t *reverse_glyph_map, /* OUT */ - hb_sorted_vector_t> *new_to_old_gid_list /* OUT */, + hb_sorted_vector_t *new_to_old_gid_list /* OUT */, unsigned int *num_glyphs /* OUT */) { unsigned pop = all_gids_to_retain->get_population (); @@ -851,7 +850,7 @@ _create_old_gid_to_new_gid_map (const hb_face_t *face, { + hb_iter (all_gids_to_retain) | hb_map ([] (hb_codepoint_t _) { - return hb_pair_t (_, _); + return hb_codepoint_pair_t (_, _); }) | hb_sink (new_to_old_gid_list) ; @@ -866,7 +865,7 @@ _create_old_gid_to_new_gid_map (const hb_face_t *face, | hb_sink (reverse_glyph_map) ; + hb_iter (new_to_old_gid_list) - | hb_map (&hb_pair_t::reverse) + | hb_map (&hb_codepoint_pair_t::reverse) | hb_sink (glyph_map) ; diff --git a/src/test-map.cc b/src/test-map.cc index 61cc8bfb3..cb722eb92 100644 --- a/src/test-map.cc +++ b/src/test-map.cc @@ -79,7 +79,7 @@ main (int argc, char **argv) s.set (1, 2); s.set (3, 4); - hb_vector_t> v (s); + hb_vector_t v (s); hb_map_t v0 (v); hb_map_t v1 (s); hb_map_t v2 (std::move (s)); @@ -112,7 +112,7 @@ main (int argc, char **argv) /* Test initializing from initializer list and swapping. */ { - using pair_t = hb_pair_t; + using pair_t = hb_codepoint_pair_t; hb_map_t v1 {pair_t{1,2}, pair_t{4,5}}; hb_map_t v2 {pair_t{3,4}}; hb_swap (v1, v2); @@ -149,7 +149,7 @@ main (int argc, char **argv) /* Test hashing maps. */ { - using pair = hb_pair_t; + using pair = hb_codepoint_pair_t; hb_hashmap_t m1; diff --git a/src/test-set.cc b/src/test-set.cc index 5f13ab322..853aed406 100644 --- a/src/test-set.cc +++ b/src/test-set.cc @@ -91,7 +91,7 @@ main (int argc, char **argv) s << 12; /* Sink a range. */ - s << hb_pair_t {1, 3}; + s << hb_codepoint_pair_t {1, 3}; hb_set_t v (hb_iter (s));