[COLR] Fix variation code

pull/3928/head
Behdad Esfahbod 2 years ago
parent ff332b14ea
commit c64661b2f8
  1. 16
      src/hb-ot-color-colr-table.hh

@ -930,6 +930,7 @@ struct ClipBox
}
bool get_extents (hb_glyph_extents_t *extents,
const DeltaSetIndexMap &varIdxMap,
const VariationStore &varStore,
hb_array_t<int> coords) const
{
@ -944,10 +945,10 @@ struct ClipBox
if (u.format == 2 && coords && u.format2.varIdxBase != HB_OT_LAYOUT_NO_VARIATIONS_INDEX)
{
uint32_t varIdx = u.format2.varIdxBase;
extents->x_bearing += _hb_roundf (varStore.get_delta (varIdx , coords));
extents->y_bearing += _hb_roundf (varStore.get_delta (varIdx+1, coords));
extents->width += _hb_roundf (varStore.get_delta (varIdx+2, coords));
extents->height += _hb_roundf (varStore.get_delta (varIdx+3, coords));
extents->x_bearing += _hb_roundf (varStore.get_delta (varIdxMap.map (varIdx+0), coords));
extents->y_bearing += _hb_roundf (varStore.get_delta (varIdxMap.map (varIdx+1), coords));
extents->width += _hb_roundf (varStore.get_delta (varIdxMap.map (varIdx+2), coords));
extents->height += _hb_roundf (varStore.get_delta (varIdxMap.map (varIdx+3), coords));
}
return true;
@ -986,10 +987,11 @@ struct ClipRecord
bool get_extents (hb_glyph_extents_t *extents,
const void *base,
const DeltaSetIndexMap &varIdxMap,
const VariationStore &varStore,
hb_array_t<int> coords) const
{
return (base+clipBox).get_extents (extents, varStore, coords);
return (base+clipBox).get_extents (extents, varIdxMap, varStore, coords);
}
public:
@ -1095,13 +1097,14 @@ struct ClipList
bool
get_extents (hb_codepoint_t gid,
hb_glyph_extents_t *extents,
const DeltaSetIndexMap &varIdxMap,
const VariationStore &varStore,
hb_array_t<int> coords) const
{
auto *rec = clips.as_array ().bsearch (gid);
if (rec)
{
rec->get_extents (extents, this, varStore, coords);
rec->get_extents (extents, this, varIdxMap, varStore, coords);
return true;
}
return false;
@ -1575,6 +1578,7 @@ struct COLR
return false;
if ((this+clipList).get_extents (glyph,
extents,
this+varIdxMap,
this+varStore,
hb_array (font->coords, font->num_coords)))
{

Loading…
Cancel
Save