From bea26446d2063cadb0cd83c1c627d3eed95cbcf6 Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Tue, 15 Aug 2023 14:20:54 -0700 Subject: [PATCH] [instancer] reference all points for gvar If a point is not referenced and delta is not inferred, set delta to 0 --- src/hb-ot-var-common.hh | 16 ++++++++++++++-- ...-codepoint.wght=200-300-500,wdth=80-90.ttf | Bin 7452 -> 7292 bytes ...ain-all-codepoint.wght=300-600,wdth=85.ttf | Bin 6780 -> 6760 bytes 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-var-common.hh b/src/hb-ot-var-common.hh index 0a92e00df..d35b10cd1 100644 --- a/src/hb-ot-var-common.hh +++ b/src/hb-ot-var-common.hh @@ -993,8 +993,20 @@ struct tuple_delta_t start_point = end_point + 1; } - for (unsigned i : inferred_idxes) - indices[i] = true; + for (unsigned i = 0; i < point_count; i++) + { + /* if points are not referenced and deltas are not inferred, set to 0. + * reference all points for gvar */ + if ( !indices[i]) + { + if (!inferred_idxes.has (i)) + { + deltas_x.arrayZ[i] = 0.f; + deltas_y.arrayZ[i] = 0.f; + } + indices[i] = true; + } + } return true; } diff --git a/test/subset/data/expected/glyf_partial_instancing/Roboto-Variable.composite.no-tables-with-item-variations.retain-all-codepoint.wght=200-300-500,wdth=80-90.ttf b/test/subset/data/expected/glyf_partial_instancing/Roboto-Variable.composite.no-tables-with-item-variations.retain-all-codepoint.wght=200-300-500,wdth=80-90.ttf index 503c755838e73b7ebe1e761f205182b63d59764e..2e55653057963b1911308c25114baf1ecaca7ef4 100644 GIT binary patch delta 379 zcmXwvze@sP7{|ZQd++)4tRV!?L>d~T7DbCgi0|qK3yLHQ3;iMjgjWTqU?eJL@McLMJ-Iecz9TBYA z40v7Mi#E@7S6(+K8)^9dd_I}@idbws_WjWDA>5l}dQWC~X*AL-D;~EN%x24NSttp- zJKP)&&7wfjiDahJ4ElYUb%Ug7Vqf6R;g!LlQWK~-kwULmK&Kl6ecrfkV={NF%As!>&doQQfO1c7unQx~3$_L+B| HYOMbO@?&N@ delta 531 zcmexkF~@2`858f6i4_(+>t-`EFfee1FfcINP25w(#NM*mf>DE!rDx^B1)Ect6j(Q_ za9v=MV_*cTVq#zil5z|zK$3yM3QXEEx-&LSUc^4F9w_O+;H$vO;F|za4CDZTZvwN- zQ7Btm0mxTiW6(-qVqiD`k@reqkvR%sOGz>?;s8ty5|4#N86H0T{rmCbhd{u=@#xXR zhamPd28Cvp58~n!GyJZxtBARzF8L0-NQpJ|el*K$aj7&4q|W|6#eN7A5?!JwH< z;`wt4h6@)6XnepSDPhKNs+q;)@@13gMuzBSHjT4qH5isIZDg1%#HlTV#}ks1Z8;_D zSr{0bS^hIJ{{P>|@V}W2!~*&oueCE77~2^@$~%DJgI8q($XE_|C^jLOEewo}Al*Db W>)C*+7#V;nC$Hr!-~5TEiyr{YG;6y6 diff --git a/test/subset/data/expected/glyf_partial_instancing/Roboto-Variable.composite.no-tables-with-item-variations.retain-all-codepoint.wght=300-600,wdth=85.ttf b/test/subset/data/expected/glyf_partial_instancing/Roboto-Variable.composite.no-tables-with-item-variations.retain-all-codepoint.wght=300-600,wdth=85.ttf index 74343354d2dd2325d2941f7c2bf6c71c6cfd1433..fc890fb96db4015d8ba95379ffe2bbefb188d483 100644 GIT binary patch delta 249 zcmexk^1@_7x?lKv*v#@=S^4>eMurQ`Y%e4wUoaRL zv`7i3@E`g5<;%NwpFe;3VrBK}^%p2$;Amv{)y$&)`LnuRBZFNto5ZbK5)6k9wJO0qtZ5+S$OQH#v)yZ}KeWSDPzXSwsOeK3P5h delta 236 zcmaE1^2cOCx?lwZ1H-?xg7n-KtSv?i3|wC(R_KW_&jE_QNH0q)vI_B5W?*1x0rJ00 z+!M`MF6791)~EaOVB~~kj*tr%8ZliS)NXw!z|4l#gI997qfA_Ap;|WAp?Vy zBm*N3z$E$if}-Nz6DPiZKLG+KxwybIkT}O+*v#@=S^4>eMurQ`Y%e4wUoaRLG)fAm z@E`g5<;%NwpFe;3VrBK}^%p4MVEEO{qW<}_x?LlKT{D}+Ew)<{42KRiPL5%b+nmD6 GA_@R&UstgJ