[>64k:layout] Add List16OfOffsetTo

This commit is contained in:
Behdad Esfahbod 2022-07-11 13:06:48 -06:00
parent 6d0e3e677b
commit f6c2aaeea4
1 changed files with 6 additions and 3 deletions

View File

@ -743,8 +743,8 @@ template <typename Type> using Array16OfOffset32To = ArrayOf<OffsetTo<Type, HBUI
template <typename Type> using Array32OfOffset32To = ArrayOf<OffsetTo<Type, HBUINT32>, HBUINT32>;
/* Array of offsets relative to the beginning of the array itself. */
template <typename Type>
struct List16OfOffset16To : Array16OfOffset16To<Type>
template <typename Type, typename OffsetType>
struct List16OfOffsetTo : ArrayOf<OffsetTo<Type, OffsetType>, HBUINT16>
{
const Type& operator [] (int i_) const
{
@ -762,7 +762,7 @@ struct List16OfOffset16To : Array16OfOffset16To<Type>
bool subset (hb_subset_context_t *c) const
{
TRACE_SUBSET (this);
struct List16OfOffset16To<Type> *out = c->serializer->embed (*this);
struct List16OfOffsetTo *out = c->serializer->embed (*this);
if (unlikely (!out)) return_trace (false);
unsigned int count = this->len;
for (unsigned int i = 0; i < count; i++)
@ -778,6 +778,9 @@ struct List16OfOffset16To : Array16OfOffset16To<Type>
}
};
template <typename Type>
using List16OfOffset16To = List16OfOffsetTo<Type, HBUINT16>;
/* An array starting at second element. */
template <typename Type, typename LenType=HBUINT16>
struct HeadlessArrayOf