diff --git a/src/graph/graph.hh b/src/graph/graph.hh index 435e51a9d..234a26159 100644 --- a/src/graph/graph.hh +++ b/src/graph/graph.hh @@ -552,7 +552,7 @@ struct graph_t auto& child = vertices_[child_id]; child.parents.push (new_parent_idx); - old_v.remove_real_link (child_id); + old_v.remove_real_link (child_id); // TODO: needs to include offset to ensure correct one removed child.remove_parent (old_parent_idx); } diff --git a/src/graph/pairpos-graph.hh b/src/graph/pairpos-graph.hh index 4576330e4..ed1ba0d55 100644 --- a/src/graph/pairpos-graph.hh +++ b/src/graph/pairpos-graph.hh @@ -127,7 +127,35 @@ struct PairPosFormat1 : public OT::Layout::GPOS_impl::PairPosFormat1_3iter (), hb_range ()) + | hb_filter ([&] (hb_pair_t p) { + return p.second >= start && p.second < end; + }) + | hb_map_retains_sorting (hb_first) + ; + + unsigned coverage_prime_id = c.create_node (coverage_size); + auto& coverage_prime_obj = c.graph.vertices_[coverage_prime_id].obj; + hb_serialize_context_t serializer = hb_serialize_context_t (coverage_prime_obj.head, + coverage_size); + Coverage_serialize (&serializer, new_coverage); + serializer.end_serialize (); + if (serializer.in_error ()) + return -1; + + hb_blob_ptr_t coverage_copy = serializer.copy_blob (); + memcpy (coverage_prime_obj.head, + coverage_copy.get (), + coverage_copy.get_length ()); + coverage_prime_obj.tail = coverage_prime_obj.head + coverage_copy.get_length (); + // TODO: add coverage as a child + return pair_pos_prime_id; }