From 92122421c951f6f126eff902f917b403bdf027a5 Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Fri, 13 Jan 2023 11:42:58 -0800 Subject: [PATCH 1/7] [instancer] update vhea/hhea tables --- src/OT/glyf/Glyph.hh | 11 +++++++++-- src/hb-ot-hmtx-table.hh | 43 +++++++++++++++++++++++++++++++++++------ src/hb-subset-plan.hh | 4 ++++ 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index 1fcad8d86..edbe4b87d 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -80,13 +80,20 @@ struct Glyph } void update_mtx (const hb_subset_plan_t *plan, - int xMin, int yMax, + int xMin, int xMax, + int yMin, int yMax, const contour_point_vector_t &all_points) const { hb_codepoint_t new_gid = 0; if (!plan->new_gid_for_old_gid (gid, &new_gid)) return; + if (type != EMPTY) + { + plan->bounds_width_map.set (new_gid, xMax - xMin); + plan->bounds_height_map.set (new_gid, yMax - yMin); + } + unsigned len = all_points.length; float leftSideX = all_points[len - 4].x; float rightSideX = all_points[len - 3].x; @@ -133,7 +140,7 @@ struct Glyph yMax = hb_max (yMax, y); } - update_mtx (plan, roundf (xMin), roundf (yMax), all_points); + update_mtx (plan, roundf (xMin), roundf (xMax), roundf (yMin), roundf (yMax), all_points); /*for empty glyphs: all_points only include phantom points. *just update metrics and then return */ diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh index d35c60126..9e92c2b71 100644 --- a/src/hb-ot-hmtx-table.hh +++ b/src/hb-ot-hmtx-table.hh @@ -78,7 +78,9 @@ struct hmtxvmtx { return T::is_horizontal ? &plan->hmtx_map : &plan->vmtx_map; } bool subset_update_header (hb_subset_context_t *c, - unsigned int num_hmetrics) const + unsigned int num_hmetrics, + const hb_hashmap_t> *mtx_map, + const hb_map_t *bounds_map) const { hb_blob_t *src_blob = hb_sanitize_context_t ().reference_table (c->plan->source, H::tableTag); hb_blob_t *dest_blob = hb_blob_copy_writable_or_fail (src_blob); @@ -108,6 +110,36 @@ struct hmtxvmtx HB_ADD_MVAR_VAR (HB_OT_METRICS_TAG_VERTICAL_CARET_RUN, caretSlopeRun); HB_ADD_MVAR_VAR (HB_OT_METRICS_TAG_VERTICAL_CARET_OFFSET, caretOffset); } + + int min_lsb = 0x7FFF; + int min_training_sb = 0x7FFF; + int max_extent = -0x7FFF; + unsigned max_adv = 0; + for (const auto _ : *mtx_map) + { + hb_codepoint_t gid = _.first; + unsigned adv = _.second.first; + int lsb = _.second.second; + max_adv = hb_max (max_adv, adv); + + if (bounds_map->has (gid)) + { + unsigned bound_width = bounds_map->get (gid); + int rsb = adv - lsb - bound_width; + int extent = lsb + bound_width; + min_lsb = hb_min (min_lsb, lsb); + min_training_sb = hb_min (min_training_sb, rsb); + max_extent = hb_max (max_extent, extent); + } + } + + table->advanceMax = max_adv; + if (!bounds_map->is_empty ()) + { + table->minLeadingBearing = min_lsb; + table->minTrailingBearing = min_training_sb; + table->maxExtent = max_extent; + } } #endif @@ -189,7 +221,8 @@ struct hmtxvmtx return_trace (false); // Amend header num hmetrics - if (unlikely (!subset_update_header (c, num_long_metrics))) + if (unlikely (!subset_update_header (c, num_long_metrics, mtx_map, + T::is_horizontal ? &c->plan->bounds_width_map : &c->plan->bounds_height_map))) return_trace (false); return_trace (true); @@ -362,15 +395,13 @@ struct hmtxvmtx unsigned new_gid, const accelerator_t &_mtx) const { - if (mtx_map->is_empty () || - (new_gid == 0 && !mtx_map->has (new_gid))) + if (mtx_map->is_empty ()) { hb_codepoint_t old_gid = 0; return plan->old_gid_for_new_gid (new_gid, &old_gid) ? _mtx.get_advance_without_var_unscaled (old_gid) : 0; } - else - { return mtx_map->get (new_gid).first; } + return mtx_map->get (new_gid).first; } protected: diff --git a/src/hb-subset-plan.hh b/src/hb-subset-plan.hh index d7979b8a7..124369a49 100644 --- a/src/hb-subset-plan.hh +++ b/src/hb-subset-plan.hh @@ -163,6 +163,10 @@ struct hb_subset_plan_t mutable hb_hashmap_t> hmtx_map; //vmtx metrics map: new gid->(advance, lsb) mutable hb_hashmap_t> vmtx_map; + //boundsWidth map: new gid->boundsWidth, boundWidth=xMax - xMin + mutable hb_map_t bounds_width_map; + //boundsHeight map: new gid->boundsHeight, boundsHeight=yMax - yMin + mutable hb_map_t bounds_height_map; #ifdef HB_EXPERIMENTAL_API // name table overrides map: hb_ot_name_record_ids_t-> name string new value or From 1f948e7fd55ff6a65aa3a6b038284db3d211493e Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Tue, 17 Jan 2023 15:16:17 -0800 Subject: [PATCH 2/7] [instancer] store recalculated head/maxp info in subset plan --- src/OT/glyf/Glyph.hh | 50 +++++++++++++++++++++++++++++++++++++------ src/OT/glyf/glyf.hh | 2 +- src/hb-subset-plan.hh | 27 +++++++++++++++++++++++ 3 files changed, 72 insertions(+), 7 deletions(-) diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index edbe4b87d..70adf56d8 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -141,6 +141,19 @@ struct Glyph } update_mtx (plan, roundf (xMin), roundf (xMax), roundf (yMin), roundf (yMax), all_points); + + int rounded_xMin = roundf (xMin); + int rounded_xMax = roundf (xMax); + int rounded_yMin = roundf (yMin); + int rounded_yMax = roundf (yMax); + + if (type != EMPTY) + { + plan->head_maxp_info.xMin = hb_min (plan->head_maxp_info.xMin, rounded_xMin); + plan->head_maxp_info.yMin = hb_min (plan->head_maxp_info.yMin, rounded_yMin); + plan->head_maxp_info.xMax = hb_max (plan->head_maxp_info.xMax, rounded_xMax); + plan->head_maxp_info.yMax = hb_max (plan->head_maxp_info.yMax, rounded_yMax); + } /*for empty glyphs: all_points only include phantom points. *just update metrics and then return */ @@ -148,10 +161,11 @@ struct Glyph return true; glyph_header->numberOfContours = header->numberOfContours; - glyph_header->xMin = roundf (xMin); - glyph_header->yMin = roundf (yMin); - glyph_header->xMax = roundf (xMax); - glyph_header->yMax = roundf (yMax); + + glyph_header->xMin = rounded_xMin; + glyph_header->yMin = rounded_yMin; + glyph_header->xMax = rounded_xMax; + glyph_header->yMax = rounded_yMax; dest_bytes = hb_bytes_t ((const char *)glyph_header, GlyphHeader::static_size); return true; @@ -164,7 +178,8 @@ struct Glyph hb_bytes_t &dest_end /* OUT */) { contour_point_vector_t all_points, deltas; - if (!get_points (font, glyf, all_points, &deltas, false, false)) + unsigned composite_contours = 0; + if (!get_points (font, glyf, all_points, &deltas, &plan->head_maxp_info, &composite_contours, false, false)) return false; // .notdef, set type to empty so we only update metrics and don't compile bytes for @@ -210,6 +225,8 @@ struct Glyph bool get_points (hb_font_t *font, const accelerator_t &glyf_accelerator, contour_point_vector_t &all_points /* OUT */, contour_point_vector_t *deltas = nullptr, /* OUT */ + head_maxp_info_t * head_maxp_info = nullptr, /* OUT */ + unsigned *composite_contours = nullptr, /* OUT */ bool shift_points_hori = true, bool use_my_metrics = true, bool phantom_only = false, @@ -222,6 +239,11 @@ struct Glyph if (!edge_count) edge_count = &stack_edge_count; if (unlikely (*edge_count > HB_GLYF_MAX_EDGE_COUNT)) return false; (*edge_count)++; + + if (head_maxp_info) + { + head_maxp_info->maxComponentDepth = hb_max (head_maxp_info->maxComponentDepth, depth); + } if (!coords) coords = hb_array (font->coords, font->num_coords); @@ -233,6 +255,10 @@ struct Glyph switch (type) { case SIMPLE: + if (depth == 0 && head_maxp_info) + head_maxp_info->maxContours = hb_max (head_maxp_info->maxContours, (unsigned) header->numberOfContours); + if (depth > 0 && composite_contours) + *composite_contours += (unsigned) header->numberOfContours; if (unlikely (!SimpleGlyph (*header, bytes).get_contour_points (points, phantom_only))) return false; break; @@ -308,6 +334,8 @@ struct Glyph switch (type) { case SIMPLE: + if (depth == 0 && head_maxp_info) + head_maxp_info->maxPoints = hb_max (head_maxp_info->maxPoints, points.length - 4); if (!inplace) all_points.extend (points.as_array ()); break; @@ -318,12 +346,13 @@ struct Glyph for (auto &item : get_composite_iterator ()) { comp_points.reset (); - if (unlikely (!glyf_accelerator.glyph_for_gid (item.get_gid ()) .get_points (font, glyf_accelerator, comp_points, deltas, + head_maxp_info, + composite_contours, shift_points_hori, use_my_metrics, phantom_only, @@ -365,6 +394,13 @@ struct Glyph comp_index++; } + if (head_maxp_info && depth == 0) + { + if (composite_contours) + head_maxp_info->maxCompositeContours = hb_max (head_maxp_info->maxCompositeContours, *composite_contours); + head_maxp_info->maxCompositePoints = hb_max (head_maxp_info->maxCompositePoints, all_points.length); + head_maxp_info->maxComponentElements = hb_max (head_maxp_info->maxComponentElements, comp_index); + } all_points.extend (phantoms); } break; #ifndef HB_NO_VAR_COMPOSITES @@ -390,6 +426,8 @@ struct Glyph glyf_accelerator, comp_points, deltas, + head_maxp_info, + nullptr, shift_points_hori, use_my_metrics, phantom_only, diff --git a/src/OT/glyf/glyf.hh b/src/OT/glyf/glyf.hh index d219d6fd3..fafaa0e92 100644 --- a/src/OT/glyf/glyf.hh +++ b/src/OT/glyf/glyf.hh @@ -194,7 +194,7 @@ struct glyf_accelerator_t contour_point_vector_t all_points; bool phantom_only = !consumer.is_consuming_contour_points (); - if (unlikely (!glyph_for_gid (gid).get_points (font, *this, all_points, nullptr, true, true, phantom_only))) + if (unlikely (!glyph_for_gid (gid).get_points (font, *this, all_points, nullptr, nullptr, nullptr, true, true, phantom_only))) return false; if (consumer.is_consuming_contour_points ()) diff --git a/src/hb-subset-plan.hh b/src/hb-subset-plan.hh index 124369a49..c5db27cc2 100644 --- a/src/hb-subset-plan.hh +++ b/src/hb-subset-plan.hh @@ -41,6 +41,30 @@ namespace OT { struct Feature; } +struct head_maxp_info_t +{ + head_maxp_info_t () + :xMin (0x7FFF), xMax (-0x7FFF), yMin (0x7FFF), yMax (-0x7FFF), + maxPoints (0), maxContours (0), + maxCompositePoints (0), + maxCompositeContours (0), + maxComponentElements (0), + maxComponentDepth (0) {} + + int xMin; + int xMax; + int yMin; + int yMax; + unsigned maxPoints; + unsigned maxContours; + unsigned maxCompositePoints; + unsigned maxCompositeContours; + unsigned maxComponentElements; + unsigned maxComponentDepth; +}; + +typedef struct head_maxp_info_t head_maxp_info_t; + struct hb_subset_plan_t { HB_INTERNAL hb_subset_plan_t (hb_face_t *, @@ -168,6 +192,9 @@ struct hb_subset_plan_t //boundsHeight map: new gid->boundsHeight, boundsHeight=yMax - yMin mutable hb_map_t bounds_height_map; + //recalculated head/maxp table info after instancing + mutable head_maxp_info_t head_maxp_info; + #ifdef HB_EXPERIMENTAL_API // name table overrides map: hb_ot_name_record_ids_t-> name string new value or // None to indicate should remove From 2ecb1c31e90657a5a264f4b84907bad6f07673c1 Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Wed, 18 Jan 2023 09:52:00 -0800 Subject: [PATCH 3/7] [instancer] always recalculate bounds when --instance option enabled But don't recompile glyph bytes if pinned at default --- src/OT/glyf/Glyph.hh | 48 ++++++++++++++++++++++++-------------------- src/OT/glyf/glyf.hh | 5 +++-- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index 70adf56d8..088854a6a 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -116,7 +116,7 @@ struct Glyph hb_bytes_t &dest_bytes /* OUT */) const { GlyphHeader *glyph_header = nullptr; - if (type != EMPTY && all_points.length > 4) + if (!plan->pinned_at_default && type != EMPTY && all_points.length > 4) { glyph_header = (GlyphHeader *) hb_calloc (1, GlyphHeader::static_size); if (unlikely (!glyph_header)) return false; @@ -155,8 +155,9 @@ struct Glyph plan->head_maxp_info.yMax = hb_max (plan->head_maxp_info.yMax, rounded_yMax); } - /*for empty glyphs: all_points only include phantom points. - *just update metrics and then return */ + /* when pinned at default, no need to compile glyph header + * and for empty glyphs: all_points only include phantom points. + * just update metrics and then return */ if (!glyph_header) return true; @@ -188,25 +189,28 @@ struct Glyph !(plan->flags & HB_SUBSET_FLAGS_NOTDEF_OUTLINE)) type = EMPTY; - switch (type) { - case COMPOSITE: - if (!CompositeGlyph (*header, bytes).compile_bytes_with_deltas (dest_start, - deltas, - dest_end)) - return false; - break; - case SIMPLE: - if (!SimpleGlyph (*header, bytes).compile_bytes_with_deltas (all_points, - plan->flags & HB_SUBSET_FLAGS_NO_HINTING, - dest_end)) - return false; - break; - default: - /* set empty bytes for empty glyph - * do not use source glyph's pointers */ - dest_start = hb_bytes_t (); - dest_end = hb_bytes_t (); - break; + //dont compile bytes when pinned at default, just recalculate bounds + if (!plan->pinned_at_default) { + switch (type) { + case COMPOSITE: + if (!CompositeGlyph (*header, bytes).compile_bytes_with_deltas (dest_start, + deltas, + dest_end)) + return false; + break; + case SIMPLE: + if (!SimpleGlyph (*header, bytes).compile_bytes_with_deltas (all_points, + plan->flags & HB_SUBSET_FLAGS_NO_HINTING, + dest_end)) + return false; + break; + default: + /* set empty bytes for empty glyph + * do not use source glyph's pointers */ + dest_start = hb_bytes_t (); + dest_end = hb_bytes_t (); + break; + } } if (!compile_header_bytes (plan, all_points, dest_start)) diff --git a/src/OT/glyf/glyf.hh b/src/OT/glyf/glyf.hh index fafaa0e92..f3d862b12 100644 --- a/src/OT/glyf/glyf.hh +++ b/src/OT/glyf/glyf.hh @@ -80,7 +80,7 @@ struct glyf _populate_subset_glyphs (c->plan, glyphs); hb_font_t *font = nullptr; - if (!c->plan->pinned_at_default) + if (c->plan->normalized_coords) { font = _create_font_for_instancing (c->plan); if (unlikely (!font)) return false; @@ -108,7 +108,8 @@ struct glyf if (font) { - _free_compiled_subset_glyphs (&glyphs); + if (!c->plan->pinned_at_default) + _free_compiled_subset_glyphs (&glyphs); hb_font_destroy (font); } From 94c390d07835727c201bfdbe0b4d208dc3fe3fc2 Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Wed, 18 Jan 2023 10:15:47 -0800 Subject: [PATCH 4/7] [instancer] update head table --- src/OT/glyf/glyf-helpers.hh | 7 +++++++ src/hb-ot-head-table.hh | 2 ++ src/hb-subset.cc | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/OT/glyf/glyf-helpers.hh b/src/OT/glyf/glyf-helpers.hh index 33e4dbe46..7b4ba274c 100644 --- a/src/OT/glyf/glyf-helpers.hh +++ b/src/OT/glyf/glyf-helpers.hh @@ -44,6 +44,13 @@ _add_head_and_set_loca_version (hb_subset_plan_t *plan, bool use_short_loca) head *head_prime = (head *) hb_blob_get_data_writable (head_prime_blob, nullptr); head_prime->indexToLocFormat = use_short_loca ? 0 : 1; + if (plan->normalized_coords) + { + head_prime->xMin = plan->head_maxp_info.xMin; + head_prime->xMax = plan->head_maxp_info.xMax; + head_prime->yMin = plan->head_maxp_info.yMin; + head_prime->yMax = plan->head_maxp_info.yMax; + } bool success = plan->add_table (HB_OT_TAG_head, head_prime_blob); hb_blob_destroy (head_prime_blob); diff --git a/src/hb-ot-head-table.hh b/src/hb-ot-head-table.hh index 20991aab2..c2dceb2d0 100644 --- a/src/hb-ot-head-table.hh +++ b/src/hb-ot-head-table.hh @@ -148,10 +148,12 @@ struct head January 1, 1904. 64-bit integer */ LONGDATETIME modified; /* Number of seconds since 12:00 midnight, January 1, 1904. 64-bit integer */ + public: HBINT16 xMin; /* For all glyph bounding boxes. */ HBINT16 yMin; /* For all glyph bounding boxes. */ HBINT16 xMax; /* For all glyph bounding boxes. */ HBINT16 yMax; /* For all glyph bounding boxes. */ + protected: HBUINT16 macStyle; /* Bit 0: Bold (if set to 1); * Bit 1: Italic (if set to 1) * Bit 2: Underline (if set to 1) diff --git a/src/hb-subset.cc b/src/hb-subset.cc index 9b5b73cec..0d2e4544d 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -413,7 +413,7 @@ _dependencies_satisfied (hb_subset_plan_t *plan, hb_tag_t tag, { case HB_OT_TAG_hmtx: case HB_OT_TAG_vmtx: - return plan->pinned_at_default || !pending_subset_tags.has (HB_OT_TAG_glyf); + return !plan->normalized_coords || !pending_subset_tags.has (HB_OT_TAG_glyf); default: return true; } From 0de7f83a9fe2054ad2d63c3f8e08dc61e1397c62 Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Wed, 18 Jan 2023 13:33:34 -0800 Subject: [PATCH 5/7] [instancer] update maxp table --- src/hb-ot-maxp-table.hh | 13 +++++++++++++ src/hb-subset.cc | 1 + 2 files changed, 14 insertions(+) diff --git a/src/hb-ot-maxp-table.hh b/src/hb-ot-maxp-table.hh index 3a019ef78..05cbf2ced 100644 --- a/src/hb-ot-maxp-table.hh +++ b/src/hb-ot-maxp-table.hh @@ -109,11 +109,24 @@ struct maxp if (c->plan->flags & HB_SUBSET_FLAGS_NO_HINTING) drop_hint_fields (dest_v1); + + if (c->plan->normalized_coords) + instancing_update_fields (c->plan->head_maxp_info, dest_v1); } return_trace (true); } + void instancing_update_fields (head_maxp_info_t& maxp_info, maxpV1Tail* dest_v1) const + { + dest_v1->maxPoints = maxp_info.maxPoints; + dest_v1->maxContours = maxp_info.maxContours; + dest_v1->maxCompositePoints = maxp_info.maxCompositePoints; + dest_v1->maxCompositeContours = maxp_info.maxCompositeContours; + dest_v1->maxComponentElements = maxp_info.maxComponentElements; + dest_v1->maxComponentDepth = maxp_info.maxComponentDepth; + } + static void drop_hint_fields (maxpV1Tail* dest_v1) { dest_v1->maxZones = 1; diff --git a/src/hb-subset.cc b/src/hb-subset.cc index 0d2e4544d..82df3386f 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -413,6 +413,7 @@ _dependencies_satisfied (hb_subset_plan_t *plan, hb_tag_t tag, { case HB_OT_TAG_hmtx: case HB_OT_TAG_vmtx: + case HB_OT_TAG_maxp: return !plan->normalized_coords || !pending_subset_tags.has (HB_OT_TAG_glyf); default: return true; From 30058f489a43c39b7bd9278c1e04baf1952bba48 Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Wed, 18 Jan 2023 15:23:24 -0800 Subject: [PATCH 6/7] [instancer] trim .notdef outline data after recalc bounds If outline data present, we use it to recalc bounds and then trim it accordingly --- src/OT/glyf/Glyph.hh | 4 ++++ src/OT/glyf/glyf.hh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index 088854a6a..826cc1cb2 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -187,7 +187,11 @@ struct Glyph // it if (gid == 0 && !(plan->flags & HB_SUBSET_FLAGS_NOTDEF_OUTLINE)) + { type = EMPTY; + dest_start = hb_bytes_t (); + dest_end = hb_bytes_t (); + } //dont compile bytes when pinned at default, just recalculate bounds if (!plan->pinned_at_default) { diff --git a/src/OT/glyf/glyf.hh b/src/OT/glyf/glyf.hh index f3d862b12..84d57ae3a 100644 --- a/src/OT/glyf/glyf.hh +++ b/src/OT/glyf/glyf.hh @@ -407,7 +407,7 @@ glyf::_populate_subset_glyphs (const hb_subset_plan_t *plan, if (unlikely (new_gid == 0 && !(plan->flags & HB_SUBSET_FLAGS_NOTDEF_OUTLINE)) && - plan->pinned_at_default) + !plan->normalized_coords) subset_glyph.source_glyph = glyf_impl::Glyph (); else { From 89d332559ee4d5349315b35e64b34c27116ba441 Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Fri, 20 Jan 2023 14:15:19 -0800 Subject: [PATCH 7/7] [instancer] add tests --- ....retain-all-codepoint.wght=150,wdth=80.ttf | Bin 114200 -> 114200 bytes ....retain-all-codepoint.wght=300,wdth=90.ttf | Bin 114300 -> 114300 bytes ....retain-all-codepoint.wght=150,wdth=80.ttf | Bin 114200 -> 114200 bytes ....retain-all-codepoint.wght=300,wdth=90.ttf | Bin 114300 -> 114300 bytes .../MPLUS1-Variable.default.30DD.wght=100.ttf | Bin 1460 -> 1460 bytes .../MPLUS1-Variable.default.30DD.wght=400.ttf | Bin 1712 -> 1712 bytes ....retain-all-codepoint.wght=200,wdth=90.ttf | Bin 6760 -> 6760 bytes ....retain-all-codepoint.wght=650,wdth=85.ttf | Bin 6712 -> 6712 bytes ....retain-all-codepoint.wght=200,wdth=90.ttf | Bin 6440 -> 6440 bytes ....retain-all-codepoint.wght=650,wdth=85.ttf | Bin 6392 -> 6392 bytes ...-all-codepoint.wght=150,wdth=80,CTGR=0.ttf | Bin 1396 -> 1396 bytes ...-all-codepoint.wght=300,wdth=90,CTGR=0.ttf | Bin 1432 -> 1432 bytes ...tain-all-codepoint.wght=400,wdth=100.0.ttf | Bin 6804 -> 6804 bytes ...etain-all-codepoint.wght=drop,wdth=100.ttf | Bin 6804 -> 6804 bytes test/subset/generate-expected-outputs.py | 3 ++- 15 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/subset/data/expected/full_instance/Roboto-Variable.default.retain-all-codepoint.wght=150,wdth=80.ttf b/test/subset/data/expected/full_instance/Roboto-Variable.default.retain-all-codepoint.wght=150,wdth=80.ttf index ca2aeeff6e314d44c9c9ad93a76bace4fcd65332..6c7a145896eb7cb61ffeb15a66902b18372bf6a1 100644 GIT binary patch delta 89 zcmbR7hi%3mwh0?Vn4EQHF)%RBVPIe|%g9JgzCxW88j>kuhiw08v^V_5c6? delta 89 zcmbR7hi%3mwh0?VnEiETF)%RBVPIe|%g9Jg diff --git a/test/subset/data/expected/full_instance/Roboto-Variable.default.retain-all-codepoint.wght=300,wdth=90.ttf b/test/subset/data/expected/full_instance/Roboto-Variable.default.retain-all-codepoint.wght=300,wdth=90.ttf index 04be94efe94c9a36fb3a89b8abcf0c6e0dadfd7d..02a3a6723001a2366b431ec02028d4fa7cf48cd0 100644 GIT binary patch delta 89 zcmezKhwaZFwh0?Vm=5a9VqjpL!@$5`mXVQ~$fd*ab>fkI92|#!$^UcZm^ZnLQA(*O tY-(UUzs*+$X%3(|28JUa1oc4l?MLSoe#!s6$}z9`7~}S1jEvj%007=DA(8+9 delta 89 zcmezKhwaZFwh0?VnEiETF)%RBVPIe|%g9JgxB1E-%>h)$z;NV)pdN_6{ph^HFR8y*ISreSF>XJ`$hd6}0D_nwlmGw# diff --git a/test/subset/data/expected/full_instance/Roboto-Variable.no-prune-unicode-ranges.retain-all-codepoint.wght=150,wdth=80.ttf b/test/subset/data/expected/full_instance/Roboto-Variable.no-prune-unicode-ranges.retain-all-codepoint.wght=150,wdth=80.ttf index ca2aeeff6e314d44c9c9ad93a76bace4fcd65332..6c7a145896eb7cb61ffeb15a66902b18372bf6a1 100644 GIT binary patch delta 89 zcmbR7hi%3mwh0?Vn4EQHF)%RBVPIe|%g9JgzCxW88j>kuhiw08v^V_5c6? delta 89 zcmbR7hi%3mwh0?VnEiETF)%RBVPIe|%g9Jg diff --git a/test/subset/data/expected/full_instance/Roboto-Variable.no-prune-unicode-ranges.retain-all-codepoint.wght=300,wdth=90.ttf b/test/subset/data/expected/full_instance/Roboto-Variable.no-prune-unicode-ranges.retain-all-codepoint.wght=300,wdth=90.ttf index 04be94efe94c9a36fb3a89b8abcf0c6e0dadfd7d..02a3a6723001a2366b431ec02028d4fa7cf48cd0 100644 GIT binary patch delta 89 zcmezKhwaZFwh0?Vm=5a9VqjpL!@$5`mXVQ~$fd*ab>fkI92|#!$^UcZm^ZnLQA(*O tY-(UUzs*+$X%3(|28JUa1oc4l?MLSoe#!s6$}z9`7~}S1jEvj%007=DA(8+9 delta 89 zcmezKhwaZFwh0?VnEiETF)%RBVPIe|%g9JgxB1E-%>h)$z;NV)pdN_6{ph^HFR8y*ISreSF>XJ`$hd6}0D_nwlmGw# diff --git a/test/subset/data/expected/instance_feature_variations/MPLUS1-Variable.default.30DD.wght=100.ttf b/test/subset/data/expected/instance_feature_variations/MPLUS1-Variable.default.30DD.wght=100.ttf index 2f3e913a591838c3f9f912da368e7025096ea320..702609418d7fe288b00f71a31ccb3f2f7f16daf8 100644 GIT binary patch delta 122 zcmdnOy@h+i1QD4}LX`{*Oj8&b7|b#)Z$=%!Jxpv%KUipIz~A*21$k#=9bBq7*Db6c%fxHc>$9I2ZO@@ PH_VTj!#5vb`oaVN+2kIB delta 122 zcmdnOy@h+i1QDHRp(6|oOj8&b7|b#JWgLfpKyTqZWsV$p58(F9;u>ypB1&&W#qRXt!s5$Y9F0+wf{A3o!WXT&0 zvJCzV>qQArzvD8hz f#<+~-;i`RxlN*>MIQ}pF_euCT%bd*%m;_h=Q1mE8 diff --git a/test/subset/data/expected/instantiate_glyf/Roboto-Variable.ABC.default.retain-all-codepoint.wght=200,wdth=90.ttf b/test/subset/data/expected/instantiate_glyf/Roboto-Variable.ABC.default.retain-all-codepoint.wght=200,wdth=90.ttf index fee5f9d4d7fb2b8be4e955a66a546ce0cd1a385c..190aee18057756dc3804a607640cab1a50579e9c 100644 GIT binary patch delta 125 zcmaE1^1@`o1`(EJI*beqOaTlG3}zV_sfj!S%qkO)=rYgXzdrFxx~d@qGf)PofI)yk zpJ5h|@r=I|ECLZ{_@Bj)GP#jaM2G=s413N$9tH-Mw+w0wYAiLAmoaW)F)*t-IXQ+& Uf`dWr|7(^S)+3v1nBIs305fzR(EtDd delta 125 zcmaE1^1@`o1`%d|ommVFOaTlG3}zV_sfk>>SeH&bqRYHR;Ml}3>8dLkL>bB$*cq4@ z1Q_%gKq{Z{mohLjFaj|c{Lf-YncT=IA_Np-V9)u-!@$7l^-JoX7pLLmWsI9xOe2c6 XPmW=d;P@r=_bR6$NAczwrZ?gMPfQ}u diff --git a/test/subset/data/expected/instantiate_glyf/Roboto-Variable.ABC.default.retain-all-codepoint.wght=650,wdth=85.ttf b/test/subset/data/expected/instantiate_glyf/Roboto-Variable.ABC.default.retain-all-codepoint.wght=650,wdth=85.ttf index 2b44f1fe075201cf17f9f34d3ab046b7a42bfa4b..38264db3eef69af63fe528456b9f350ca51fc74b 100644 GIT binary patch delta 125 zcmdmCvcqJ;1`$>^9cBgwrT_*82D6Ne)I^>FW`&7IbeU)HU!V9TUDc2QC<_Ek3<3=L z46}fYXZ)pL5r{a$|15@-$&HL6LJW)y4D31oco-O1{xb+O2(Y}Lyo_-Zi=bZY=gBcl U5*!S||KG5@XFa;PhG~yD0PAHQqyPW_ delta 125 zcmdmCvcqJ;1`%d|ommVFOaTlG3}zV_sfk>>SeH&bqRYHR;Ml}3>8dLkL>bB$*cq4@ z1Q_%gKq{Z{mohLjFaj|c{Lf-YncT=IA_Np-V9)u-!@$7l^-JoX7pLLmWsI9x#4m*2 XogBj?!SPG#?^RAij^fQVOnbxuC_W;h diff --git a/test/subset/data/expected/instantiate_glyf/Roboto-Variable.composite.default.retain-all-codepoint.wght=200,wdth=90.ttf b/test/subset/data/expected/instantiate_glyf/Roboto-Variable.composite.default.retain-all-codepoint.wght=200,wdth=90.ttf index 060f7356899f720fb4cbbcd0286a0200d33f97a9..0fa5526636647c30450e9f315ec4bde6cb4fb834 100644 GIT binary patch delta 144 zcmZ2sw8Ch@1`)Pnx|0|fm~t2x7|b#6v&=N}IP1KVi^Ee0dDnUjw(u2VU( nexGnWzs*+$X%4XZBOe6yK#bdu&MN?wF|f^Kci23GX@VF4;lU$2 delta 144 zcmZ2sw8Ch@1`%d|ommVFOgRh;3}zV_sfk>>SeHyZqRYHR;Ml}3?W!voL>bB$*cq4@ z1Q_%gKq{Z{mohLjFaj|c{Lf-YnY@ruLzC9&FHXbB#~9bCT*}_d m9M5m_l|h;Vtp3OcK|K)T_M`I(zohFb!m~t2x7|b#6v&=N}IP1KV2$P6j8o)sv4gu2Yfv n?HC)+Z}XKwnggu<$Ol0^5aafv^9n#^3~Z~}oi@*4N)Q78F-Rjs delta 144 zcmexi_``6*1`%d|ommVFOgRh;3}zV_sfk>>SeHyZqRYHR;Ml}3?W!voL>bB$*cq4@ z1Q_%gKq{Z{mohLjFaj|c{Lf-YnY@ruLzC9&FHXbB#~9bCXjD6F mjpw)d${@`FR)6G!pdN^E`_XxYUs8XsavE|JZ=S)FAO-*(wkSaW diff --git a/test/subset/data/expected/mvar_full_instance/NotoSans-VF.abc.no-layout.retain-all-codepoint.wght=150,wdth=80,CTGR=0.ttf b/test/subset/data/expected/mvar_full_instance/NotoSans-VF.abc.no-layout.retain-all-codepoint.wght=150,wdth=80,CTGR=0.ttf index 7b086cbe8b216f17c5dbfca301319c10055479fa..5a46c6482ef80deb855a930c8be18f3c89bfe144 100644 GIT binary patch delta 103 zcmeyu^@VFffQYQCwFLtMV*vvLgIPvKY9gCBW5C1|U1oL$t%*~-q!=_An1E716<`vH tnD|4BgDHYRi$Q{M-()RDKb9>GJDexiFiLPRX#M}jxR2?_<~fWvm;oL<7X$zR delta 103 zcmeyu^@VFffQa$~s}Bqej0Fq~3}zV_sfj$B*?T6Y=rXG_Zk#y9ON!B&L4u)>fsKI? zr~m<27+5C$(Bj~h_&fRU6s`}GwHWfsKI? zr~m<27+5C$(Bj~h_&fRU6s`}GwHWmIt1`$?!9VP|_rT_*82D6Ne)I^?@%*hjv=rYgXzdrFxx~d@qGf)PofI)yk zpJ5h|@r=I|ECLZ{_@Bj)GP#jaM2LZrfq^~e9}fcqs|ABBgA}XWh# UB*DQT`~MBA9P5$IHB1r`0P6r8#Q*>R delta 125 zcmbPYI>mIt1`%d|ommVFOaTlG3}zV_sfk>>SeH&bqRYHR;Ml}3>8dLkL>bB$*cq4@ z1Q_%gKq{Z{mohLjFaj|c{Lf-YncT=IA_Np-V9)u-!@$7l^-JoX7pLLmWsI9xlGSZu XC&w^JaQu?`dzI6Wqj+--lY|5S@--mC diff --git a/test/subset/data/expected/pin_all_at_default/Roboto-Variable.ABC.default.retain-all-codepoint.wght=drop,wdth=100.ttf b/test/subset/data/expected/pin_all_at_default/Roboto-Variable.ABC.default.retain-all-codepoint.wght=drop,wdth=100.ttf index 1523a99f9e018230144e18725fcf1e4d7bc1e830..adceacd3200f70728528c222f3f62abc50d6f5ed 100644 GIT binary patch delta 125 zcmbPYI>mIt1`$?!9VP|_rT_*82D6Ne)I^?@%*hjv=rYgXzdrFxx~d@qGf)PofI)yk zpJ5h|@r=I|ECLZ{_@Bj)GP#jaM2LZrfq^~e9}fcqs|ABBgA}XWh# UB*DQT`~MBA9P5$IHB1r`0P6r8#Q*>R delta 125 zcmbPYI>mIt1`%d|ommVFOaTlG3}zV_sfk>>SeH&bqRYHR;Ml}3>8dLkL>bB$*cq4@ z1Q_%gKq{Z{mohLjFaj|c{Lf-YncT=IA_Np-V9)u-!@$7l^-JoX7pLLmWsI9xlGSZu XC&w^JaQu?`dzI6Wqj+--lY|5S@--mC diff --git a/test/subset/generate-expected-outputs.py b/test/subset/generate-expected-outputs.py index 2b7a87f29..53fb774a1 100755 --- a/test/subset/generate-expected-outputs.py +++ b/test/subset/generate-expected-outputs.py @@ -33,7 +33,6 @@ def generate_expected_output(input_file, unicodes, profile_flags, instance_flags instance_path = os.path.join(tempfile.mkdtemp (), font_name) args = ["fonttools", "varLib.instancer", "--no-overlap-flag", - "--no-recalc-bounds", "--no-recalc-timestamp", "--output=%s" % instance_path, input_file] @@ -43,6 +42,8 @@ def generate_expected_output(input_file, unicodes, profile_flags, instance_flags fonttools_path = os.path.join(tempfile.mkdtemp (), font_name) args = ["fonttools", "subset", input_path] + if instance_flags: + args.extend(["--recalc-bounds"]) args.extend(["--drop-tables+=DSIG", "--drop-tables-=sbix", "--no-harfbuzz-repacker", # disable harfbuzz repacker so we aren't comparing to ourself.