mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-04 21:15:06 +00:00
Revert "[VARC] Store axisIndices and axisValues as HBUINT16"
This reverts commit b76d88b3b4e977747a4fb7f4b82963d9f0a4e63f.
This commit is contained in:
parent
671f2daa29
commit
ac8c1aaf8e
3 changed files with 10 additions and 19 deletions
|
@ -192,22 +192,17 @@ VarComponent::get_path_at (hb_font_t *font,
|
||||||
|
|
||||||
// Axis values
|
// Axis values
|
||||||
|
|
||||||
hb_array_t<const HBINT16> axisIndices;
|
hb_vector_t<unsigned> axisIndices;
|
||||||
hb_vector_t<float> axisValues;
|
hb_vector_t<float> axisValues;
|
||||||
if (flags & (unsigned) flags_t::HAVE_AXES)
|
if (flags & (unsigned) flags_t::HAVE_AXES)
|
||||||
{
|
{
|
||||||
unsigned axisIndicesIndex;
|
unsigned axisIndicesIndex;
|
||||||
READ_UINT32VAR (axisIndicesIndex);
|
READ_UINT32VAR (axisIndicesIndex);
|
||||||
axisIndices = (&VARC+VARC.axisIndicesList)[axisIndicesIndex];
|
axisIndices = (&VARC+VARC.axisIndicesList)[axisIndicesIndex];
|
||||||
if (axisValues.resize (axisIndices.length))
|
axisValues.resize (axisIndices.length);
|
||||||
{
|
const HBUINT8 *p = (const HBUINT8 *) record;
|
||||||
if (unlikely (unsigned (end - record) < axisIndices.length * sizeof (HBINT16)))
|
TupleValues::decompile (p, axisValues, (const HBUINT8 *) end);
|
||||||
return hb_ubytes_t ();
|
record += (const unsigned char *) p - record;
|
||||||
const HBINT16 *base = (const HBINT16 *) record;
|
|
||||||
for (unsigned i = 0; i < axisIndices.length; i++)
|
|
||||||
axisValues.arrayZ[i] = base[i];
|
|
||||||
}
|
|
||||||
record += axisIndices.length * sizeof (HBINT16);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply variations if any
|
// Apply variations if any
|
||||||
|
|
|
@ -178,7 +178,7 @@ struct VARC
|
||||||
Offset32To<Coverage> coverage;
|
Offset32To<Coverage> coverage;
|
||||||
Offset32To<MultiItemVariationStore> varStore;
|
Offset32To<MultiItemVariationStore> varStore;
|
||||||
Offset32To<ConditionList> conditionList;
|
Offset32To<ConditionList> conditionList;
|
||||||
Offset32To<Int16TupleList> axisIndicesList;
|
Offset32To<TupleList> axisIndicesList;
|
||||||
Offset32To<CFF2Index/*Of<VarCompositeGlyph>*/> glyphRecords;
|
Offset32To<CFF2Index/*Of<VarCompositeGlyph>*/> glyphRecords;
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_STATIC (24);
|
DEFINE_SIZE_STATIC (24);
|
||||||
|
|
|
@ -1879,20 +1879,16 @@ struct TupleList : CFF2Index
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Type>
|
struct FloatTupleList : CFF2Index
|
||||||
struct TypedTupleList : CFF2Index
|
|
||||||
{
|
{
|
||||||
hb_array_t<const Type> operator [] (unsigned i) const
|
hb_array_t<const float> operator [] (unsigned i) const
|
||||||
{
|
{
|
||||||
auto bytes = CFF2Index::operator [] (i);
|
auto bytes = CFF2Index::operator [] (i);
|
||||||
return hb_array (&StructAtOffsetUnaligned<Type>(bytes.arrayZ, 0),
|
return hb_array (&StructAtOffsetUnaligned<float>(bytes.arrayZ, 0),
|
||||||
bytes.length / hb_static_size (Type));
|
bytes.length / sizeof (float));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
using Int16TupleList = TypedTupleList<HBINT16>;
|
|
||||||
using FloatTupleList = TypedTupleList<float>;
|
|
||||||
|
|
||||||
|
|
||||||
} /* namespace OT */
|
} /* namespace OT */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue