summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz-ng/src/OT/Layout/GPOS/PairPosFormat2.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/OT/Layout/GPOS/PairPosFormat2.hh')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/OT/Layout/GPOS/PairPosFormat2.hh39
1 files changed, 27 insertions, 12 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/OT/Layout/GPOS/PairPosFormat2.hh b/src/3rdparty/harfbuzz-ng/src/OT/Layout/GPOS/PairPosFormat2.hh
index 4adb1ef606..dd02da887d 100644
--- a/src/3rdparty/harfbuzz-ng/src/OT/Layout/GPOS/PairPosFormat2.hh
+++ b/src/3rdparty/harfbuzz-ng/src/OT/Layout/GPOS/PairPosFormat2.hh
@@ -8,7 +8,7 @@ namespace Layout {
namespace GPOS_impl {
template <typename Types>
-struct PairPosFormat2_4
+struct PairPosFormat2_4 : ValueBase
{
protected:
HBUINT16 format; /* Format identifier--format = 2 */
@@ -287,18 +287,31 @@ struct PairPosFormat2_4
unsigned len2 = valueFormat2.get_len ();
hb_pair_t<unsigned, unsigned> newFormats = hb_pair (valueFormat1, valueFormat2);
- if (c->plan->flags & HB_SUBSET_FLAGS_NO_HINTING)
- newFormats = compute_effective_value_formats (klass1_map, klass2_map);
- out->valueFormat1 = newFormats.first;
- out->valueFormat2 = newFormats.second;
-
- if (c->plan->all_axes_pinned)
+ if (c->plan->normalized_coords)
+ {
+ /* in case of full instancing, all var device flags will be dropped so no
+ * need to strip hints here */
+ newFormats = compute_effective_value_formats (klass1_map, klass2_map, false, false, &c->plan->layout_variation_idx_delta_map);
+ }
+ /* do not strip hints for VF */
+ else if (c->plan->flags & HB_SUBSET_FLAGS_NO_HINTING)
{
- out->valueFormat1 = out->valueFormat1.drop_device_table_flags ();
- out->valueFormat2 = out->valueFormat2.drop_device_table_flags ();
+ hb_blob_t* blob = hb_face_reference_table (c->plan->source, HB_TAG ('f','v','a','r'));
+ bool has_fvar = (blob != hb_blob_get_empty ());
+ hb_blob_destroy (blob);
+
+ bool strip = !has_fvar;
+ /* special case: strip hints when a VF has no GDEF varstore after
+ * subsetting*/
+ if (has_fvar && !c->plan->has_gdef_varstore)
+ strip = true;
+ newFormats = compute_effective_value_formats (klass1_map, klass2_map, strip, true);
}
+ out->valueFormat1 = newFormats.first;
+ out->valueFormat2 = newFormats.second;
+
unsigned total_len = len1 + len2;
hb_vector_t<unsigned> class2_idxs (+ hb_range ((unsigned) class2Count) | hb_filter (klass2_map));
for (unsigned class1_idx : + hb_range ((unsigned) class1Count) | hb_filter (klass1_map))
@@ -326,7 +339,9 @@ struct PairPosFormat2_4
hb_pair_t<unsigned, unsigned> compute_effective_value_formats (const hb_map_t& klass1_map,
- const hb_map_t& klass2_map) const
+ const hb_map_t& klass2_map,
+ bool strip_hints, bool strip_empty,
+ const hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> *varidx_delta_map = nullptr) const
{
unsigned len1 = valueFormat1.get_len ();
unsigned len2 = valueFormat2.get_len ();
@@ -340,8 +355,8 @@ struct PairPosFormat2_4
for (unsigned class2_idx : + hb_range ((unsigned) class2Count) | hb_filter (klass2_map))
{
unsigned idx = (class1_idx * (unsigned) class2Count + class2_idx) * record_size;
- format1 = format1 | valueFormat1.get_effective_format (&values[idx]);
- format2 = format2 | valueFormat2.get_effective_format (&values[idx + len1]);
+ format1 = format1 | valueFormat1.get_effective_format (&values[idx], strip_hints, strip_empty, this, varidx_delta_map);
+ format2 = format2 | valueFormat2.get_effective_format (&values[idx + len1], strip_hints, strip_empty, this, varidx_delta_map);
}
if (format1 == valueFormat1 && format2 == valueFormat2)