[instance] don't copy phantom points from component

No need to consider USE_MY_METRICS for instancing
This commit is contained in:
Qunxin Liu 2022-08-26 08:24:19 -07:00
parent 58dbc00162
commit 8f84c58a34
2 changed files with 5 additions and 4 deletions

View File

@ -148,7 +148,7 @@ struct Glyph
hb_bytes_t &dest_end /* OUT */) const hb_bytes_t &dest_end /* OUT */) const
{ {
contour_point_vector_t all_points, deltas; contour_point_vector_t all_points, deltas;
get_points (font, glyf, all_points, &deltas); get_points (font, glyf, all_points, &deltas, false);
switch (type) { switch (type) {
case COMPOSITE: case COMPOSITE:
@ -182,6 +182,7 @@ struct Glyph
bool get_points (hb_font_t *font, const accelerator_t &glyf_accelerator, bool get_points (hb_font_t *font, const accelerator_t &glyf_accelerator,
contour_point_vector_t &all_points /* OUT */, contour_point_vector_t &all_points /* OUT */,
contour_point_vector_t *deltas = nullptr, /* OUT */ contour_point_vector_t *deltas = nullptr, /* OUT */
bool use_my_metrics = true,
bool phantom_only = false, bool phantom_only = false,
unsigned int depth = 0) const unsigned int depth = 0) const
{ {
@ -270,11 +271,11 @@ struct Glyph
comp_points.reset (); comp_points.reset ();
if (unlikely (!glyf_accelerator.glyph_for_gid (item.get_gid ()) if (unlikely (!glyf_accelerator.glyph_for_gid (item.get_gid ())
.get_points (font, glyf_accelerator, comp_points, .get_points (font, glyf_accelerator, comp_points,
deltas, phantom_only, depth + 1))) deltas, use_my_metrics, phantom_only, depth + 1)))
return false; return false;
/* Copy phantom points from component if USE_MY_METRICS flag set */ /* Copy phantom points from component if USE_MY_METRICS flag set */
if (item.is_use_my_metrics ()) if (use_my_metrics && item.is_use_my_metrics ())
for (unsigned int i = 0; i < PHANTOM_COUNT; i++) for (unsigned int i = 0; i < PHANTOM_COUNT; i++)
phantoms[i] = comp_points[comp_points.length - PHANTOM_COUNT + i]; phantoms[i] = comp_points[comp_points.length - PHANTOM_COUNT + i];

View File

@ -180,7 +180,7 @@ struct glyf_accelerator_t
contour_point_vector_t all_points; contour_point_vector_t all_points;
bool phantom_only = !consumer.is_consuming_contour_points (); bool phantom_only = !consumer.is_consuming_contour_points ();
if (unlikely (!glyph_for_gid (gid).get_points (font, *this, all_points, nullptr, phantom_only))) if (unlikely (!glyph_for_gid (gid).get_points (font, *this, all_points, nullptr, true, phantom_only)))
return false; return false;
if (consumer.is_consuming_contour_points ()) if (consumer.is_consuming_contour_points ())