diff --git a/src/OT/Var/VARC/VARC.cc b/src/OT/Var/VARC/VARC.cc index 899b2f17f..1afb57111 100644 --- a/src/OT/Var/VARC/VARC.cc +++ b/src/OT/Var/VARC/VARC.cc @@ -192,22 +192,17 @@ VarComponent::get_path_at (hb_font_t *font, // Axis values - hb_array_t axisIndices; + hb_vector_t axisIndices; hb_vector_t axisValues; if (flags & (unsigned) flags_t::HAVE_AXES) { unsigned axisIndicesIndex; READ_UINT32VAR (axisIndicesIndex); axisIndices = (&VARC+VARC.axisIndicesList)[axisIndicesIndex]; - if (axisValues.resize (axisIndices.length)) - { - if (unlikely (unsigned (end - record) < axisIndices.length * sizeof (HBINT16))) - return hb_ubytes_t (); - const HBINT16 *base = (const HBINT16 *) record; - for (unsigned i = 0; i < axisIndices.length; i++) - axisValues.arrayZ[i] = base[i]; - } - record += axisIndices.length * sizeof (HBINT16); + axisValues.resize (axisIndices.length); + const HBUINT8 *p = (const HBUINT8 *) record; + TupleValues::decompile (p, axisValues, (const HBUINT8 *) end); + record += (const unsigned char *) p - record; } // Apply variations if any diff --git a/src/OT/Var/VARC/VARC.hh b/src/OT/Var/VARC/VARC.hh index d91e9750e..d60f7b0c2 100644 --- a/src/OT/Var/VARC/VARC.hh +++ b/src/OT/Var/VARC/VARC.hh @@ -178,7 +178,7 @@ struct VARC Offset32To coverage; Offset32To varStore; Offset32To conditionList; - Offset32To axisIndicesList; + Offset32To axisIndicesList; Offset32To*/> glyphRecords; public: DEFINE_SIZE_STATIC (24); diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 8480a04f7..a52b65b5e 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -1879,20 +1879,16 @@ struct TupleList : CFF2Index } }; -template -struct TypedTupleList : CFF2Index +struct FloatTupleList : CFF2Index { - hb_array_t operator [] (unsigned i) const + hb_array_t operator [] (unsigned i) const { auto bytes = CFF2Index::operator [] (i); - return hb_array (&StructAtOffsetUnaligned(bytes.arrayZ, 0), - bytes.length / hb_static_size (Type)); + return hb_array (&StructAtOffsetUnaligned(bytes.arrayZ, 0), + bytes.length / sizeof (float)); } }; -using Int16TupleList = TypedTupleList; -using FloatTupleList = TypedTupleList; - } /* namespace OT */