diff --git a/src/OT/Var/VARC/VARC.cc b/src/OT/Var/VARC/VARC.cc index cf764d0ed..9915fe43c 100644 --- a/src/OT/Var/VARC/VARC.cc +++ b/src/OT/Var/VARC/VARC.cc @@ -223,7 +223,7 @@ VarComponent::get_path_at (hb_font_t *font, * limit on the max number of coords for now. */ if ((flags & (unsigned) flags_t::RESET_UNSPECIFIED_AXES) || coords.length > HB_VAR_COMPOSITE_MAX_AXES) - component_coords = hb_array (font->coords, font->num_coords); + component_coords = hb_array (font->coords, font->num_coords); // Transform diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index 2c289d511..9dddd7cd5 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -328,7 +328,7 @@ struct Glyph head_maxp_info->maxComponentDepth = hb_max (head_maxp_info->maxComponentDepth, depth); } - if (!coords) + if (!coords && font->has_nonzero_coords) coords = hb_array (font->coords, font->num_coords); contour_point_vector_t &points = type == SIMPLE ? all_points : scratch.comp_points; @@ -383,7 +383,7 @@ struct Glyph } #ifndef HB_NO_VAR - if (coords) + if (hb_any (coords)) { #ifndef HB_NO_BEYOND_64K if (glyf_accelerator.GVAR->has_data ()) diff --git a/src/OT/glyf/glyf.hh b/src/OT/glyf/glyf.hh index eb4d5523d..eb18c1bde 100644 --- a/src/OT/glyf/glyf.hh +++ b/src/OT/glyf/glyf.hh @@ -434,7 +434,7 @@ struct glyf_accelerator_t hb_codepoint_t gid, hb_glyph_extents_t *extents) const { return get_extents_at (font, gid, extents, hb_array (font->coords, - font->has_nonzer_coords ? font->num_coords : 0)); } + font->has_nonzero_coords ? font->num_coords : 0)); } bool get_extents_at (hb_font_t *font, hb_codepoint_t gid, diff --git a/src/hb-font.cc b/src/hb-font.cc index 2f0515b34..6d50b7886 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -1886,14 +1886,7 @@ _hb_font_adopt_var_coords (hb_font_t *font, font->coords = coords; font->design_coords = design_coords; font->num_coords = coords_length; - - font->has_nonzero_coords = false; - for (unsigned int i = 0; i < coords_length; i++) - if (coords[i]) - { - font->has_nonzero_coords = true; - break; - } + font->has_nonzero_coords = hb_any (hb_array (coords, coords_length)); font->mults_changed (); // Easiest to call this to drop cached data } diff --git a/src/hb-geometry.hh b/src/hb-geometry.hh index 9ee2e598a..1b32d131a 100644 --- a/src/hb-geometry.hh +++ b/src/hb-geometry.hh @@ -33,16 +33,12 @@ template struct hb_extents_t { hb_extents_t () {} -<<<<<<< HEAD hb_extents_t (const hb_glyph_extents_t &extents) : xmin (hb_min (extents.x_bearing, extents.x_bearing + extents.width)), ymin (hb_min (extents.y_bearing, extents.y_bearing + extents.height)), xmax (hb_max (extents.x_bearing, extents.x_bearing + extents.width)), ymax (hb_max (extents.y_bearing, extents.y_bearing + extents.height)) {} - hb_extents_t (float xmin, float ymin, float xmax, float ymax) : -======= hb_extents_t (Float xmin, Float ymin, Float xmax, Float ymax) : ->>>>>>> a5e4453dd ([hvgl] Use double instead of float for coords & transforms) xmin (xmin), ymin (ymin), xmax (xmax), ymax (ymax) {} bool is_empty () const { return xmin >= xmax || ymin >= ymax; }