[open-type] Remove (Sorted)ArrayOf.sub_array()

This commit is contained in:
Behdad Esfahbod 2022-11-16 21:27:12 -07:00
parent f2b5db700f
commit a0bde1e1ea
7 changed files with 10 additions and 28 deletions

View File

@ -84,7 +84,7 @@ struct AlternateSet
{
if (alternates.len && alternate_count)
{
+ alternates.sub_array (start_offset, alternate_count)
+ alternates.as_array ().sub_array (start_offset, alternate_count)
| hb_sink (hb_array (alternate_glyphs, *alternate_count))
;
}

View File

@ -90,7 +90,7 @@ typedef struct OpenTypeOffsetTable
{
if (table_count)
{
+ tables.sub_array (start_offset, table_count)
+ tables.as_array ().sub_array (start_offset, table_count)
| hb_map (&TableRecord::tag)
| hb_sink (hb_array (table_tags, *table_count))
;

View File

@ -646,15 +646,6 @@ struct ArrayOf
operator iter_t () const { return iter (); }
operator writer_t () { return writer (); }
hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int count) const
{ return as_array ().sub_array (start_offset, count); }
hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const
{ return as_array ().sub_array (start_offset, count); }
hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int count)
{ return as_array ().sub_array (start_offset, count); }
hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */)
{ return as_array ().sub_array (start_offset, count); }
template <typename T>
Type &lsearch (const T &x, Type &not_found = Crap (Type))
{ return *as_array ().lsearch (x, &not_found); }
@ -944,15 +935,6 @@ struct SortedArrayOf : ArrayOf<Type, LenType>
operator iter_t () const { return iter (); }
operator writer_t () { return writer (); }
hb_sorted_array_t<const Type> sub_array (unsigned int start_offset, unsigned int count) const
{ return as_array ().sub_array (start_offset, count); }
hb_sorted_array_t<const Type> sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const
{ return as_array ().sub_array (start_offset, count); }
hb_sorted_array_t<Type> sub_array (unsigned int start_offset, unsigned int count)
{ return as_array ().sub_array (start_offset, count); }
hb_sorted_array_t<Type> sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */)
{ return as_array ().sub_array (start_offset, count); }
bool serialize (hb_serialize_context_t *c, unsigned int items_len)
{
TRACE_SERIALIZE (this);

View File

@ -478,7 +478,7 @@ struct IndexArray : Array16Of<Index>
{
if (_count)
{
+ this->sub_array (start_offset, _count)
+ this->as_array ().sub_array (start_offset, _count)
| hb_sink (hb_array (_indexes, *_count))
;
}
@ -658,7 +658,7 @@ struct FeatureParamsCharacterVariants
{
if (char_count)
{
+ characters.sub_array (start_offset, char_count)
+ characters.as_array ().sub_array (start_offset, char_count)
| hb_sink (hb_array (chars, *char_count))
;
}
@ -932,7 +932,7 @@ struct RecordArrayOf : SortedArray16Of<Record<Type>>
{
if (record_count)
{
+ this->sub_array (start_offset, record_count)
+ this->as_array ().sub_array (start_offset, record_count)
| hb_map (&Record<Type>::tag)
| hb_sink (hb_array (record_tags, *record_count))
;

View File

@ -73,7 +73,7 @@ struct AttachList
if (point_count)
{
+ points.sub_array (start_offset, point_count)
+ points.as_array ().sub_array (start_offset, point_count)
| hb_sink (hb_array (point_array, *point_count))
;
}
@ -322,7 +322,7 @@ struct LigGlyph
{
if (caret_count)
{
+ carets.sub_array (start_offset, caret_count)
+ carets.as_array ().sub_array (start_offset, caret_count)
| hb_map (hb_add (this))
| hb_map ([&] (const CaretValue &value) { return value.get_caret_value (font, direction, glyph_id, var_store); })
| hb_sink (hb_array (caret_array, *caret_count))

View File

@ -786,7 +786,7 @@ struct MathGlyphAssembly
if (parts_count)
{
int64_t mult = font->dir_mult (direction);
for (auto _ : hb_zip (partRecords.sub_array (start_offset, parts_count),
for (auto _ : hb_zip (partRecords.as_array ().sub_array (start_offset, parts_count),
hb_array (parts, *parts_count)))
_.first.extract (_.second, mult, font);
}
@ -855,7 +855,7 @@ struct MathGlyphConstruction
if (variants_count)
{
int64_t mult = font->dir_mult (direction);
for (auto _ : hb_zip (mathGlyphVariantRecord.sub_array (start_offset, variants_count),
for (auto _ : hb_zip (mathGlyphVariantRecord.as_array ().sub_array (start_offset, variants_count),
hb_array (variants, *variants_count)))
_.second = {_.first.variantGlyph, font->em_mult (_.first.advanceMeasurement, mult)};
}

View File

@ -84,7 +84,7 @@ struct meta
{
if (count)
{
+ table->dataMaps.sub_array (start_offset, count)
+ table->dataMaps.as_array ().sub_array (start_offset, count)
| hb_map (&DataMap::get_tag)
| hb_map ([](hb_tag_t tag) { return (hb_ot_meta_tag_t) tag; })
| hb_sink (hb_array (entries, *count))