[justify] Set out params in more cases

This commit is contained in:
Behdad Esfahbod 2023-03-03 09:31:16 -07:00
parent e57defc07c
commit ab4c321180
1 changed files with 10 additions and 0 deletions

View File

@ -271,9 +271,13 @@ hb_shape_justify (hb_font_t *font,
/* If default advance already matches target, nothing to do. Shape and return. */ /* If default advance already matches target, nothing to do. Shape and return. */
if (min_target_advance <= *advance && *advance <= max_target_advance) if (min_target_advance <= *advance && *advance <= max_target_advance)
{
*var_tag = HB_TAG_NONE;
*var_value = 0.0f;
return hb_shape_full (font, buffer, return hb_shape_full (font, buffer,
features, num_features, features, num_features,
shaper_list); shaper_list);
}
hb_face_t *face = font->face; hb_face_t *face = font->face;
@ -297,6 +301,8 @@ hb_shape_justify (hb_font_t *font,
/* If no suitable variation axis found, can't justify. Just shape and return. */ /* If no suitable variation axis found, can't justify. Just shape and return. */
if (!tag) if (!tag)
{ {
*var_tag = HB_TAG_NONE;
*var_value = 0.0f;
if (hb_shape_full (font, buffer, if (hb_shape_full (font, buffer,
features, num_features, features, num_features,
shaper_list)) shaper_list))
@ -331,7 +337,11 @@ hb_shape_justify (hb_font_t *font,
* Do this again, in case advance was just calculated. * Do this again, in case advance was just calculated.
*/ */
if (min_target_advance <= *advance && *advance <= max_target_advance) if (min_target_advance <= *advance && *advance <= max_target_advance)
{
*var_tag = HB_TAG_NONE;
*var_value = 0.0f;
return true; return true;
}
/* Prepare for running the solver. */ /* Prepare for running the solver. */
double a, b, ya, yb; double a, b, ya, yb;