From 22eae32b3b5fc901929d9a27a332b03d7b4ef656 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Tue, 2 Aug 2022 21:04:38 +0000 Subject: [PATCH] [repacker] add classDef1 clone_range to PairPosFormat2 split. --- src/graph/classdef-graph.hh | 4 ++-- src/graph/coverage-graph.hh | 16 ++++++++-------- src/graph/pairpos-graph.hh | 23 +++++++++++++++++------ 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/graph/classdef-graph.hh b/src/graph/classdef-graph.hh index e81cd6ec4..c355b9732 100644 --- a/src/graph/classdef-graph.hh +++ b/src/graph/classdef-graph.hh @@ -72,7 +72,7 @@ struct ClassDef : public OT::ClassDef auto new_class_def = + glyphs | hb_map_retains_sorting ([&] (hb_codepoint_t gid) { - return hb_pair (gid, class_def_table[gid]); + return hb_pair (gid, class_def_table->get_class (gid)); }) ; @@ -98,7 +98,7 @@ struct ClassDef : public OT::ClassDef { char* buffer = (char*) hb_calloc (1, max_size); hb_serialize_context_t serializer (buffer, max_size); - ClassDef_serialize (&serializer, glyph_and_class); + OT::ClassDef_serialize (&serializer, glyph_and_class); serializer.end_serialize (); if (serializer.in_error ()) { diff --git a/src/graph/coverage-graph.hh b/src/graph/coverage-graph.hh index 28ceed945..a5e5e1491 100644 --- a/src/graph/coverage-graph.hh +++ b/src/graph/coverage-graph.hh @@ -56,18 +56,18 @@ struct CoverageFormat2 : public OT::Layout::Common::CoverageFormat2_4sanitize (coverage_v)) - return false; + return nullptr; auto new_coverage = + hb_zip (coverage_table->iter (), hb_range ()) @@ -80,7 +80,7 @@ struct Coverage : public OT::Layout::Common::Coverage unsigned coverage_prime_id = c.graph.new_node (nullptr, nullptr); auto& coverage_prime_vertex = c.graph.vertices_[coverage_prime_id]; if (!make_coverage (c, new_coverage, coverage_prime_id, coverage_size)) - return false; + return nullptr; auto* coverage_link = c.graph.vertices_[new_parent_id].obj.real_links.push (); coverage_link->width = SmallTypes::size; @@ -88,7 +88,7 @@ struct Coverage : public OT::Layout::Common::Coverage coverage_link->position = link_position; coverage_prime_vertex.parents.push (new_parent_id); - return true; + return (Coverage*) coverage_prime_vertex.obj.head; } template diff --git a/src/graph/pairpos-graph.hh b/src/graph/pairpos-graph.hh index d52d3bb09..245d519ec 100644 --- a/src/graph/pairpos-graph.hh +++ b/src/graph/pairpos-graph.hh @@ -311,14 +311,25 @@ struct PairPosFormat2 : public OT::Layout::GPOS_impl::PairPosFormat2_4iter ())) return -1; - // TODO: class def 1 (clone_classdef (start, end)) // TODO: class def 2 (just link to existing) return -1; // TODO