mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-23 07:51:10 +01:00
[subset] Skip variation instancing for avar2 partial instancing
When has_avar2 is true, route variation tables to their non-instancing code paths that still handle glyph subsetting: - HVAR/VVAR: use non-instancing VarStore serialization - GDEF: use non-instancing VarStore subsetting - MVAR: passthrough (no glyph subsetting needed) - cvar: passthrough (no glyph subsetting needed) - cvt: skip delta application - CFF2: skip blend instancing, preserve glyph subsetting - gvar: skip instantiate(), use non-instancing glyph subsetting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c7a8feb80f
commit
4fff04ee22
6 files changed
+7
-7
No files matched your search
@@ -678,7 +678,7 @@ struct GDEFVersion1_2
|
||||
if (unlikely (!c->serializer->embed (varStore))) return_trace (false);
|
||||
if (c->plan->all_axes_pinned)
|
||||
out->varStore = 0;
|
||||
else if (c->plan->normalized_coords)
|
||||
else if (c->plan->normalized_coords && !c->plan->has_avar2)
|
||||
{
|
||||
if (varStore)
|
||||
{
|
||||
|
||||
@@ -428,7 +428,7 @@ struct gvar_GVAR
|
||||
if (c->plan->all_axes_pinned)
|
||||
return_trace (false);
|
||||
|
||||
if (c->plan->normalized_coords)
|
||||
if (c->plan->normalized_coords && !c->plan->has_avar2)
|
||||
return_trace (instantiate (c));
|
||||
|
||||
unsigned glyph_count = version.to_int () ? c->plan->source->get_num_glyphs () : 0;
|
||||
|
||||
@@ -369,7 +369,7 @@ struct HVARVVAR
|
||||
out->version.major = 1;
|
||||
out->version.minor = 0;
|
||||
|
||||
if (c->plan->normalized_coords)
|
||||
if (c->plan->normalized_coords && !c->plan->has_avar2)
|
||||
{
|
||||
item_variations_t item_vars;
|
||||
if (!item_vars.instantiate (this+varStore, c->plan,
|
||||
|
||||
@@ -502,7 +502,7 @@ struct cff2_subset_plan
|
||||
orig_fdcount = acc.fdArray->count;
|
||||
|
||||
drop_hints = plan->flags & HB_SUBSET_FLAGS_NO_HINTING;
|
||||
pinned = (bool) plan->normalized_coords;
|
||||
pinned = (bool) plan->normalized_coords && !plan->has_avar2;
|
||||
normalized_coords = plan->normalized_coords;
|
||||
head_maxp_info = plan->head_maxp_info;
|
||||
hmtx_map = &plan->hmtx_map;
|
||||
|
||||
@@ -28,13 +28,13 @@ bool _hb_subset_table_var (hb_subset_plan_t *plan, hb_vector_t<char> &buf, hb_t
|
||||
*success = _hb_subset_table<const OT::avar> (plan, buf);
|
||||
return true;
|
||||
case HB_TAG('c','v','a','r'):
|
||||
if (plan->user_axes_location.is_empty ())
|
||||
if (plan->user_axes_location.is_empty () || plan->has_avar2)
|
||||
*success = _hb_subset_table_passthrough (plan, tag);
|
||||
else
|
||||
*success = _hb_subset_table<const OT::cvar> (plan, buf);
|
||||
return true;
|
||||
case HB_TAG('M','V','A','R'):
|
||||
if (plan->user_axes_location.is_empty ())
|
||||
if (plan->user_axes_location.is_empty () || plan->has_avar2)
|
||||
*success = _hb_subset_table_passthrough (plan, tag);
|
||||
else
|
||||
*success = _hb_subset_table<const OT::MVAR> (plan, buf);
|
||||
|
||||
+1
-1
@@ -286,7 +286,7 @@ _subset_table (hb_subset_plan_t *plan,
|
||||
case HB_TAG('c','v','t',' '):
|
||||
#ifndef HB_NO_VAR
|
||||
if (_is_table_present (plan->source, HB_TAG('c','v','a','r')) &&
|
||||
plan->normalized_coords && !plan->pinned_at_default)
|
||||
plan->normalized_coords && !plan->pinned_at_default && !plan->has_avar2)
|
||||
{
|
||||
auto &cvar = *plan->source->table.cvar;
|
||||
return OT::cvar::add_cvt_and_apply_deltas (plan, cvar.get_tuple_var_data (), &cvar);
|
||||
|
||||
Reference in new issue
Block a user