mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-14 17:13:40 +00:00
[instancer] add subset () for cvar
This commit is contained in:
parent
e39e02017e
commit
f55619b836
1 changed files with 39 additions and 1 deletions
|
@ -64,7 +64,7 @@ struct cvar
|
|||
if (!TupleVariationData::get_tuple_iterator (var_data_bytes, axis_count, this,
|
||||
shared_indices, &iterator))
|
||||
return false;
|
||||
|
||||
|
||||
return tupleVariationData.decompile_tuple_variations (point_count, is_gvar, iterator,
|
||||
axes_old_index_tag_map,
|
||||
shared_indices,
|
||||
|
@ -125,6 +125,44 @@ struct cvar
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool serialize (hb_serialize_context_t *c,
|
||||
TupleVariationData::tuple_variations_t& tuple_variations) const
|
||||
{
|
||||
TRACE_SERIALIZE (this);
|
||||
if (unlikely (!c->embed (version))) return_trace (false);
|
||||
|
||||
return_trace (tupleVariationData.serialize (c, false, tuple_variations));
|
||||
}
|
||||
|
||||
bool subset (hb_subset_context_t *c) const
|
||||
{
|
||||
TRACE_SUBSET (this);
|
||||
/* subset() for cvar is called by partial instancing only, we always pass
|
||||
* through cvar table in other cases */
|
||||
if (unlikely (!c->plan->normalized_coords ||
|
||||
c->plan->pinned_at_default ||
|
||||
c->plan->all_axes_pinned))
|
||||
return_trace (false);
|
||||
|
||||
OT::TupleVariationData::tuple_variations_t tuple_variations;
|
||||
unsigned axis_count = c->plan->axes_old_index_tag_map.get_population ();
|
||||
|
||||
const hb_tag_t cvt = HB_TAG('c','v','t',' ');
|
||||
hb_blob_t *cvt_blob = hb_face_reference_table (c->plan->source, cvt);
|
||||
unsigned point_count = hb_blob_get_length (cvt_blob) / FWORD::static_size;
|
||||
|
||||
if (!decompile_tuple_variations (axis_count, point_count, false,
|
||||
&(c->plan->axes_old_index_tag_map),
|
||||
tuple_variations))
|
||||
return_trace (false);
|
||||
|
||||
tuple_variations.instantiate (c->plan->axes_location);
|
||||
if (!tuple_variations.compile_bytes (c->plan->axes_index_map, c->plan->axes_old_index_tag_map))
|
||||
return_trace (false);
|
||||
|
||||
return_trace (serialize (c->serializer, tuple_variations));
|
||||
}
|
||||
|
||||
static bool add_cvt_and_apply_deltas (hb_subset_plan_t *plan,
|
||||
const TupleVariationData *tuple_var_data,
|
||||
|
|
Loading…
Add table
Reference in a new issue