diff --git a/src/hb-subset-plan-var.cc b/src/hb-subset-plan-var.cc index a1b13dd2a..1a8082cc6 100644 --- a/src/hb-subset-plan-var.cc +++ b/src/hb-subset-plan-var.cc @@ -755,7 +755,8 @@ update_instance_metrics_map_from_cff2 (hb_subset_plan_t *plan) _hmtx.get_leading_bearing_without_var_unscaled (old_gid, &lsb); } plan->hmtx_map.set (new_gid, hb_pair ((unsigned) hori_aw, lsb)); - plan->bounds_width_vec[new_gid] = extents.width; + if (has_bounds_info) + plan->bounds_width_vec[new_gid] = extents.width; } if (_vmtx.has_data ()) @@ -777,7 +778,8 @@ update_instance_metrics_map_from_cff2 (hb_subset_plan_t *plan) } plan->vmtx_map.set (new_gid, hb_pair ((unsigned) vert_aw, tsb)); - plan->bounds_height_vec[new_gid] = extents.height; + if (has_bounds_info) + plan->bounds_height_vec[new_gid] = hb_saturate_neg (extents.height); } } /* No glyph contributed bounds: do not serialize the accumulator's diff --git a/test/subset/data/expected/downgrade_cff2/SourceSerif4Variable-Roman-HelloWorld.downgrade-cff2.48,65,6C,6C,6F,20,57,6F,72,6C,64.wght=400,opsz=20.otf b/test/subset/data/expected/downgrade_cff2/SourceSerif4Variable-Roman-HelloWorld.downgrade-cff2.48,65,6C,6C,6F,20,57,6F,72,6C,64.wght=400,opsz=20.otf index e08da9e97..d2a70513b 100644 Binary files a/test/subset/data/expected/downgrade_cff2/SourceSerif4Variable-Roman-HelloWorld.downgrade-cff2.48,65,6C,6C,6F,20,57,6F,72,6C,64.wght=400,opsz=20.otf and b/test/subset/data/expected/downgrade_cff2/SourceSerif4Variable-Roman-HelloWorld.downgrade-cff2.48,65,6C,6C,6F,20,57,6F,72,6C,64.wght=400,opsz=20.otf differ diff --git a/test/subset/data/expected/downgrade_cff2/SourceSerif4Variable-Roman-HelloWorld.downgrade-cff2.48,65,6C,6C,6F,20,57,6F,72,6C,64.wght=650,opsz=48.otf b/test/subset/data/expected/downgrade_cff2/SourceSerif4Variable-Roman-HelloWorld.downgrade-cff2.48,65,6C,6C,6F,20,57,6F,72,6C,64.wght=650,opsz=48.otf index f623441a9..999d9e9e2 100644 Binary files a/test/subset/data/expected/downgrade_cff2/SourceSerif4Variable-Roman-HelloWorld.downgrade-cff2.48,65,6C,6C,6F,20,57,6F,72,6C,64.wght=650,opsz=48.otf and b/test/subset/data/expected/downgrade_cff2/SourceSerif4Variable-Roman-HelloWorld.downgrade-cff2.48,65,6C,6C,6F,20,57,6F,72,6C,64.wght=650,opsz=48.otf differ diff --git a/test/subset/data/expected/instantiate_cff2_tsb/NotoSansJP-VF.subset.default.5005,5006,5009,500D.wght=300.otf b/test/subset/data/expected/instantiate_cff2_tsb/NotoSansJP-VF.subset.default.5005,5006,5009,500D.wght=300.otf index 2e62a8a0d..0eae3260a 100644 Binary files a/test/subset/data/expected/instantiate_cff2_tsb/NotoSansJP-VF.subset.default.5005,5006,5009,500D.wght=300.otf and b/test/subset/data/expected/instantiate_cff2_tsb/NotoSansJP-VF.subset.default.5005,5006,5009,500D.wght=300.otf differ