From bd9cdecd59b24f0886df3ce605fc1a8be18c4546 Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Mon, 5 Jun 2023 13:52:05 -0700 Subject: [PATCH] [instancer] add decompile_tuple_variations() for cvar table --- src/hb-ot-var-cvar-table.hh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/hb-ot-var-cvar-table.hh b/src/hb-ot-var-cvar-table.hh index 7fd0f1d79..7b11f88de 100644 --- a/src/hb-ot-var-cvar-table.hh +++ b/src/hb-ot-var-cvar-table.hh @@ -51,6 +51,25 @@ struct cvar const TupleVariationData* get_tuple_var_data (void) const { return &tupleVariationData; } + bool decompile_tuple_variations (unsigned axis_count, + unsigned point_count, + bool is_gvar, + TupleVariationData::tuple_variations_t& tuple_variations /* OUT */) const + { + hb_vector_t shared_indices; + TupleVariationData::tuple_iterator_t iterator; + unsigned var_data_length = tupleVariationData.get_size (axis_count); + hb_bytes_t var_data_bytes = hb_bytes_t (reinterpret_cast (get_tuple_var_data ()), var_data_length); + if (!TupleVariationData::get_tuple_iterator (var_data_bytes, axis_count, this, + shared_indices, &iterator)) + return true; + + return tupleVariationData.decompile_tuple_variations (point_count, is_gvar, iterator, + shared_indices, + hb_array (), + tuple_variations); + } + static bool calculate_cvt_deltas (unsigned axis_count, hb_array_t coords, unsigned num_cvt_item,