[subset] Skip GPOS value format optimization for avar2

Don't compute effective value formats using layout_variation_idx_delta_map
when has_avar2 is true. The delta map contains wrong deltas (computed
from intermediate-space coords, not final coords) and could incorrectly
strip device table format flags, breaking GPOS variation references.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Behdad EsfahbodandClaude Opus 4.6 committed 2026-07-01 12:42:56 -06:00
1 parent 483bd446cb
commit c6b0cd5e07
4 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -156,7 +156,7 @@ struct PairPosFormat1_3
hb_pair_t<unsigned, unsigned> newFormats = hb_pair (valueFormat[0], valueFormat[1]);
if (c->plan->normalized_coords)
if (c->plan->normalized_coords && !c->plan->has_avar2)
{
/* all device flags will be dropped when full instancing, no need to strip
* hints, also do not strip emtpy cause we don't compute the new default
+1 -1
View File
@@ -312,7 +312,7 @@ struct PairPosFormat2_4 : ValueBase
hb_pair_t<unsigned, unsigned> newFormats = hb_pair (valueFormat1, valueFormat2);
if (c->plan->normalized_coords)
if (c->plan->normalized_coords && !c->plan->has_avar2)
{
/* in case of full instancing, all var device flags will be dropped so no
* need to strip hints here */
+1 -1
View File
@@ -149,7 +149,7 @@ struct SinglePosFormat1 : ValueBase
unsigned new_format = valueFormat;
if (c->plan->normalized_coords)
if (c->plan->normalized_coords && !c->plan->has_avar2)
{
new_format = valueFormat.get_effective_format (values.arrayZ, false, false, this, &c->plan->layout_variation_idx_delta_map);
}
+1 -1
View File
@@ -195,7 +195,7 @@ struct SinglePosFormat2 : ValueBase
;
unsigned new_format = compute_effective_format (c->plan->source, it,
bool (c->plan->normalized_coords),
bool (c->plan->normalized_coords) && !c->plan->has_avar2,
bool (c->plan->flags & HB_SUBSET_FLAGS_NO_HINTING),
c->plan->has_gdef_varstore,
&c->plan->layout_variation_idx_delta_map);