[Glyph] Pass down coords to get_points

This commit is contained in:
Behdad Esfahbod 2022-12-09 18:42:46 -07:00
parent 8e46870093
commit e9e503b80b
1 changed files with 24 additions and 5 deletions

View File

@ -211,9 +211,14 @@ struct Glyph
bool shift_points_hori = true, bool shift_points_hori = true,
bool use_my_metrics = true, bool use_my_metrics = true,
bool phantom_only = false, bool phantom_only = false,
hb_array_t<int> coords = hb_array_t<int> (),
unsigned int depth = 0) const unsigned int depth = 0) const
{ {
if (unlikely (depth > HB_MAX_NESTING_LEVEL)) return false; if (unlikely (depth > HB_MAX_NESTING_LEVEL)) return false;
if (!coords)
coords = hb_array (font->coords, font->num_coords);
contour_point_vector_t stack_points; contour_point_vector_t stack_points;
bool inplace = type == SIMPLE && all_points.length == 0; bool inplace = type == SIMPLE && all_points.length == 0;
/* Load into all_points if it's empty, as an optimization. */ /* Load into all_points if it's empty, as an optimization. */
@ -277,7 +282,7 @@ struct Glyph
#ifndef HB_NO_VAR #ifndef HB_NO_VAR
glyf_accelerator.gvar->apply_deltas_to_points (gid, glyf_accelerator.gvar->apply_deltas_to_points (gid,
hb_array (font->coords, font->num_coords), coords,
points.as_array ()); points.as_array ());
#endif #endif
@ -306,8 +311,15 @@ 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,
deltas, shift_points_hori, use_my_metrics, phantom_only, depth + 1))) glyf_accelerator,
comp_points,
deltas,
shift_points_hori,
use_my_metrics,
phantom_only,
coords,
depth + 1)))
return false; return false;
/* Apply component transformation & translation */ /* Apply component transformation & translation */
@ -359,8 +371,15 @@ struct Glyph
item.set_variations (coord_setter, record_points); item.set_variations (coord_setter, record_points);
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,
deltas, shift_points_hori, use_my_metrics, phantom_only, depth + 1))) glyf_accelerator,
comp_points,
deltas,
shift_points_hori,
use_my_metrics,
phantom_only,
hb_array (font->coords, font->num_coords),
depth + 1)))
return false; return false;
/* Apply component transformation */ /* Apply component transformation */