diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh index ed73960c8..8e7b7b529 100644 --- a/src/hb-aat-layout-common.hh +++ b/src/hb-aat-layout-common.hh @@ -659,7 +659,7 @@ struct ClassTable } protected: HBGlyphID firstGlyph; /* First glyph index included in the trimmed array. */ - ArrayOf classArray; /* The class codes (indexed by glyph index minus + Array16Of classArray; /* The class codes (indexed by glyph index minus * firstGlyph). */ public: DEFINE_SIZE_ARRAY (4, classArray); diff --git a/src/hb-aat-layout-just-table.hh b/src/hb-aat-layout-just-table.hh index 7b77a43a1..556d4ad75 100644 --- a/src/hb-aat-layout-just-table.hh +++ b/src/hb-aat-layout-just-table.hh @@ -79,7 +79,7 @@ struct DecompositionAction * to decompose before more frequent ones. The ligatures * on the line of text will decompose in increasing * value of this field. */ - ArrayOf + Array16Of decomposedglyphs; /* Number of 16-bit glyph indexes that follow; * the ligature will be decomposed into these glyphs. diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 90f306fc0..6220501e3 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -580,7 +580,7 @@ struct SortedUnsizedArrayOf : UnsizedArrayOf /* An array with a number of elements. */ -template +template struct ArrayOf { typedef Type item_t; @@ -710,8 +710,8 @@ struct ArrayOf public: DEFINE_SIZE_ARRAY (sizeof (LenType), arrayZ); }; -template -using Array32Of = ArrayOf; +template using Array16Of = ArrayOf; +template using Array32Of = ArrayOf; using PString = ArrayOf; /* Array of Offset's */ diff --git a/src/hb-ot-gasp-table.hh b/src/hb-ot-gasp-table.hh index 4f291924a..f2a9cad46 100644 --- a/src/hb-ot-gasp-table.hh +++ b/src/hb-ot-gasp-table.hh @@ -71,7 +71,7 @@ struct gasp protected: HBUINT16 version; /* Version number (set to 1) */ - ArrayOf + Array16Of gaspRanges; /* Number of records to follow * Sorted by ppem */ public: diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index dc59dcdc7..05889ef08 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -517,7 +517,7 @@ struct RangeRecord DECLARE_NULL_NAMESPACE_BYTES (OT, RangeRecord); -struct IndexArray : ArrayOf +struct IndexArray : Array16Of { bool intersects (const hb_map_t *indexes) const { return hb_any (*this, indexes); } @@ -1011,7 +1011,7 @@ struct FeatureParamsCharacterVariants * user-interface labels for the * feature parameters. (Must be zero * if numParameters is zero.) */ - ArrayOf + Array16Of characters; /* Array of the Unicode Scalar Value * of the characters for which this * feature provides glyph variants. @@ -1334,7 +1334,7 @@ struct Lookup private: HBUINT16 lookupType; /* Different enumerations for GSUB and GPOS */ HBUINT16 lookupFlag; /* Lookup qualifiers */ - ArrayOf + Array16Of subTable; /* Array of SubTables */ /*HBUINT16 markFilteringSetX[HB_VAR_ARRAY];*//* Index (base 0) into GDEF mark glyph sets * structure. This field is only present if bit @@ -2044,7 +2044,7 @@ struct ClassDefFormat1 protected: HBUINT16 classFormat; /* Format identifier--format = 1 */ HBGlyphID startGlyph; /* First GlyphID of the classValueArray */ - ArrayOf + Array16Of classValue; /* Array of Class Values--one per GlyphID */ public: DEFINE_SIZE_ARRAY (6, classValue); @@ -2718,7 +2718,7 @@ struct VarData protected: HBUINT16 itemCount; HBUINT16 shortCount; - ArrayOf regionIndices; + Array16Of regionIndices; /*UnsizedArrayOfbytesX;*/ public: DEFINE_SIZE_ARRAY (6, regionIndices); @@ -3078,7 +3078,7 @@ struct FeatureTableSubstitution protected: FixedVersion<> version; /* Version--0x00010000u */ - ArrayOf + Array16Of substitutions; public: DEFINE_SIZE_ARRAY (6, substitutions); diff --git a/src/hb-ot-layout-gdef-table.hh b/src/hb-ot-layout-gdef-table.hh index cab6e055f..00138866b 100644 --- a/src/hb-ot-layout-gdef-table.hh +++ b/src/hb-ot-layout-gdef-table.hh @@ -42,7 +42,7 @@ namespace OT { */ /* Array of contour point indices--in increasing numerical order */ -struct AttachPoint : ArrayOf +struct AttachPoint : Array16Of { bool subset (hb_subset_context_t *c) const { @@ -460,7 +460,7 @@ struct MarkGlyphSetsFormat1 protected: HBUINT16 format; /* Format identifier--format = 1 */ - ArrayOf> + Array16Of> coverage; /* Array of long offsets to mark set * coverage tables */ public: diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 6e79cf853..bd3771d9e 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -648,7 +648,7 @@ struct MarkRecord DEFINE_SIZE_STATIC (4); }; -struct MarkArray : ArrayOf /* Array of MarkRecords--in Coverage order */ +struct MarkArray : Array16Of /* Array of MarkRecords--in Coverage order */ { bool apply (hb_ot_apply_context_t *c, unsigned int mark_index, unsigned int glyph_index, @@ -657,7 +657,7 @@ struct MarkArray : ArrayOf /* Array of MarkRecords--in Coverage orde { TRACE_APPLY (this); hb_buffer_t *buffer = c->buffer; - const MarkRecord &record = ArrayOf::operator[](mark_index); + const MarkRecord &record = Array16Of::operator[](mark_index); unsigned int mark_class = record.klass; const Anchor& mark_anchor = this + record.markAnchor; @@ -702,7 +702,7 @@ struct MarkArray : ArrayOf /* Array of MarkRecords--in Coverage orde bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (ArrayOf::sanitize (c, this)); + return_trace (Array16Of::sanitize (c, this)); } }; @@ -1780,7 +1780,7 @@ struct CursivePosFormat1 Offset16To coverage; /* Offset to Coverage table--from * beginning of subtable */ - ArrayOf + Array16Of entryExitRecord; /* Array of EntryExit records--in * Coverage Index order */ public: diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 66c2d68ac..25538d52f 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -245,7 +245,7 @@ struct SingleSubstFormat2 Offset16To coverage; /* Offset to Coverage table--from * beginning of Substitution table */ - ArrayOf + Array16Of substitute; /* Array of substitute * GlyphIDs--ordered by Coverage Index */ public: @@ -386,7 +386,7 @@ struct Sequence } protected: - ArrayOf + Array16Of substitute; /* String of GlyphIDs to substitute */ public: DEFINE_SIZE_ARRAY (2, substitute); @@ -616,7 +616,7 @@ struct AlternateSet } protected: - ArrayOf + Array16Of alternates; /* Array of alternate GlyphIDs--in * arbitrary order */ public: @@ -1203,7 +1203,7 @@ struct ReverseChainSingleSubstFormat1 if (!intersects (c->glyphs)) return; const Array16OfOffset16To &lookahead = StructAfter> (backtrack); - const ArrayOf &substitute = StructAfter> (lookahead); + const Array16Of &substitute = StructAfter> (lookahead); + hb_zip (this+coverage, substitute) | hb_filter (c->parent_active_glyphs (), hb_first) @@ -1229,7 +1229,7 @@ struct ReverseChainSingleSubstFormat1 for (unsigned int i = 0; i < count; i++) if (unlikely (!(this+lookahead[i]).collect_coverage (c->after))) return; - const ArrayOf &substitute = StructAfter> (lookahead); + const Array16Of &substitute = StructAfter> (lookahead); count = substitute.len; c->output->add_array (substitute.arrayZ, substitute.len); } @@ -1249,7 +1249,7 @@ struct ReverseChainSingleSubstFormat1 if (likely (index == NOT_COVERED)) return_trace (false); const Array16OfOffset16To &lookahead = StructAfter> (backtrack); - const ArrayOf &substitute = StructAfter> (lookahead); + const Array16Of &substitute = StructAfter> (lookahead); if (unlikely (index >= substitute.len)) return_trace (false); @@ -1312,7 +1312,7 @@ struct ReverseChainSingleSubstFormat1 if (!serialize_coverage_offset_array (c, backtrack_iter)) return_trace (false); if (!serialize_coverage_offset_array (c, lookahead_iter)) return_trace (false); - auto *substitute_out = c->serializer->start_embed> (); + auto *substitute_out = c->serializer->start_embed> (); auto substitutes = + coverage_subst_iter | hb_map (hb_second) @@ -1337,7 +1337,7 @@ struct ReverseChainSingleSubstFormat1 const hb_map_t &glyph_map = *c->plan->glyph_map; const Array16OfOffset16To &lookahead = StructAfter> (backtrack); - const ArrayOf &substitute = StructAfter> (lookahead); + const Array16Of &substitute = StructAfter> (lookahead); auto it = + hb_zip (this+coverage, substitute) @@ -1358,7 +1358,7 @@ struct ReverseChainSingleSubstFormat1 const Array16OfOffset16To &lookahead = StructAfter> (backtrack); if (!lookahead.sanitize (c, this)) return_trace (false); - const ArrayOf &substitute = StructAfter> (lookahead); + const Array16Of &substitute = StructAfter> (lookahead); return_trace (substitute.sanitize (c)); } @@ -1375,7 +1375,7 @@ struct ReverseChainSingleSubstFormat1 lookaheadX; /* Array of coverage tables * in lookahead sequence, in glyph * sequence order */ - ArrayOf + Array16Of substituteX; /* Array of substitute * GlyphIDs--ordered by Coverage Index */ public: diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 924e0be65..1b3dc118d 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -2432,7 +2432,7 @@ struct ChainRule bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const { const HeadlessArrayOf &input = StructAfter> (backtrack); - const ArrayOf &lookahead = StructAfter> (input); + const Array16Of &lookahead = StructAfter> (input); return chain_context_intersects (glyphs, backtrack.len, backtrack.arrayZ, input.lenP1, input.arrayZ, @@ -2446,8 +2446,8 @@ struct ChainRule if (unlikely (c->lookup_limit_exceeded ())) return; const HeadlessArrayOf &input = StructAfter> (backtrack); - const ArrayOf &lookahead = StructAfter> (input); - const ArrayOf &lookup = StructAfter> (lookahead); + const Array16Of &lookahead = StructAfter> (input); + const Array16Of &lookup = StructAfter> (lookahead); chain_context_closure_lookup (c, backtrack.len, backtrack.arrayZ, input.lenP1, input.arrayZ, @@ -2464,8 +2464,8 @@ struct ChainRule if (!intersects (c->glyphs, lookup_context)) return; const HeadlessArrayOf &input = StructAfter> (backtrack); - const ArrayOf &lookahead = StructAfter> (input); - const ArrayOf &lookup = StructAfter> (lookahead); + const Array16Of &lookahead = StructAfter> (input); + const Array16Of &lookup = StructAfter> (lookahead); recurse_lookups (c, lookup.len, lookup.arrayZ); } @@ -2473,8 +2473,8 @@ struct ChainRule ChainContextCollectGlyphsLookupContext &lookup_context) const { const HeadlessArrayOf &input = StructAfter> (backtrack); - const ArrayOf &lookahead = StructAfter> (input); - const ArrayOf &lookup = StructAfter> (lookahead); + const Array16Of &lookahead = StructAfter> (input); + const Array16Of &lookup = StructAfter> (lookahead); chain_context_collect_glyphs_lookup (c, backtrack.len, backtrack.arrayZ, input.lenP1, input.arrayZ, @@ -2487,8 +2487,8 @@ struct ChainRule ChainContextApplyLookupContext &lookup_context) const { const HeadlessArrayOf &input = StructAfter> (backtrack); - const ArrayOf &lookahead = StructAfter> (input); - const ArrayOf &lookup = StructAfter> (lookahead); + const Array16Of &lookahead = StructAfter> (input); + const Array16Of &lookup = StructAfter> (lookahead); return chain_context_would_apply_lookup (c, backtrack.len, backtrack.arrayZ, input.lenP1, input.arrayZ, @@ -2500,8 +2500,8 @@ struct ChainRule { TRACE_APPLY (this); const HeadlessArrayOf &input = StructAfter> (backtrack); - const ArrayOf &lookahead = StructAfter> (input); - const ArrayOf &lookup = StructAfter> (lookahead); + const Array16Of &lookahead = StructAfter> (input); + const Array16Of &lookup = StructAfter> (lookahead); return_trace (chain_context_apply_lookup (c, backtrack.len, backtrack.arrayZ, input.lenP1, input.arrayZ, @@ -2539,12 +2539,12 @@ struct ChainRule serialize_array (c, input.lenP1, + input.iter () | hb_map (mapping)); - const ArrayOf &lookahead = StructAfter> (input); + const Array16Of &lookahead = StructAfter> (input); if (lookahead_map) mapping = lookahead_map; serialize_array (c, lookahead.len, + lookahead.iter () | hb_map (mapping)); - const ArrayOf &lookupRecord = StructAfter> (lookahead); + const Array16Of &lookupRecord = StructAfter> (lookahead); HBUINT16* lookupCount = c->embed (&(lookupRecord.len)); if (!lookupCount) return_trace (nullptr); @@ -2571,7 +2571,7 @@ struct ChainRule TRACE_SUBSET (this); const HeadlessArrayOf &input = StructAfter> (backtrack); - const ArrayOf &lookahead = StructAfter> (input); + const Array16Of &lookahead = StructAfter> (input); if (!backtrack_map) { @@ -2602,24 +2602,24 @@ struct ChainRule if (!backtrack.sanitize (c)) return_trace (false); const HeadlessArrayOf &input = StructAfter> (backtrack); if (!input.sanitize (c)) return_trace (false); - const ArrayOf &lookahead = StructAfter> (input); + const Array16Of &lookahead = StructAfter> (input); if (!lookahead.sanitize (c)) return_trace (false); - const ArrayOf &lookup = StructAfter> (lookahead); + const Array16Of &lookup = StructAfter> (lookahead); return_trace (lookup.sanitize (c)); } protected: - ArrayOf + Array16Of backtrack; /* Array of backtracking values * (to be matched before the input * sequence) */ HeadlessArrayOf inputX; /* Array of input values (start with * second glyph) */ - ArrayOf + Array16Of lookaheadX; /* Array of lookahead values's (to be * matched after the input sequence) */ - ArrayOf + Array16Of lookupX; /* Array of LookupRecords--in * design order) */ public: @@ -3170,7 +3170,7 @@ struct ChainContextFormat3 get_coverage ().intersected_coverage_glyphs (c->parent_active_glyphs (), c->cur_intersected_glyphs); const Array16OfOffset16To &lookahead = StructAfter> (input); - const ArrayOf &lookup = StructAfter> (lookahead); + const Array16Of &lookup = StructAfter> (lookahead); struct ChainContextClosureLookupContext lookup_context = { {intersects_coverage, intersected_coverage_glyphs}, ContextFormat::CoverageBasedContext, @@ -3191,7 +3191,7 @@ struct ChainContextFormat3 const Array16OfOffset16To &input = StructAfter> (backtrack); const Array16OfOffset16To &lookahead = StructAfter> (input); - const ArrayOf &lookup = StructAfter> (lookahead); + const Array16Of &lookup = StructAfter> (lookahead); recurse_lookups (c, lookup.len, lookup.arrayZ); } @@ -3204,7 +3204,7 @@ struct ChainContextFormat3 (this+input[0]).collect_coverage (c->input); const Array16OfOffset16To &lookahead = StructAfter> (input); - const ArrayOf &lookup = StructAfter> (lookahead); + const Array16Of &lookup = StructAfter> (lookahead); struct ChainContextCollectGlyphsLookupContext lookup_context = { {collect_coverage}, {this, this, this} @@ -3221,7 +3221,7 @@ struct ChainContextFormat3 { const Array16OfOffset16To &input = StructAfter> (backtrack); const Array16OfOffset16To &lookahead = StructAfter> (input); - const ArrayOf &lookup = StructAfter> (lookahead); + const Array16Of &lookup = StructAfter> (lookahead); struct ChainContextApplyLookupContext lookup_context = { {match_coverage}, {this, this, this} @@ -3248,7 +3248,7 @@ struct ChainContextFormat3 if (likely (index == NOT_COVERED)) return_trace (false); const Array16OfOffset16To &lookahead = StructAfter> (input); - const ArrayOf &lookup = StructAfter> (lookahead); + const Array16Of &lookup = StructAfter> (lookahead); struct ChainContextApplyLookupContext lookup_context = { {match_coverage}, {this, this, this} @@ -3298,7 +3298,7 @@ struct ChainContextFormat3 if (!serialize_coverage_offsets (c, lookahead.iter (), this)) return_trace (false); - const ArrayOf &lookupRecord = StructAfter> (lookahead); + const Array16Of &lookupRecord = StructAfter> (lookahead); HBUINT16 lookupCount; lookupCount = lookupRecord.len; if (!c->serializer->copy (lookupCount)) return_trace (false); @@ -3319,7 +3319,7 @@ struct ChainContextFormat3 if (!input.len) return_trace (false); /* To be consistent with Context. */ const Array16OfOffset16To &lookahead = StructAfter> (input); if (!lookahead.sanitize (c, this)) return_trace (false); - const ArrayOf &lookup = StructAfter> (lookahead); + const Array16Of &lookup = StructAfter> (lookahead); return_trace (lookup.sanitize (c)); } @@ -3337,7 +3337,7 @@ struct ChainContextFormat3 lookaheadX; /* Array of coverage tables * in lookahead sequence, in glyph * sequence order */ - ArrayOf + Array16Of lookupX; /* Array of LookupRecords--in * design order) */ public: diff --git a/src/hb-ot-math-table.hh b/src/hb-ot-math-table.hh index bac617c8d..5916ad29f 100644 --- a/src/hb-ot-math-table.hh +++ b/src/hb-ot-math-table.hh @@ -185,7 +185,7 @@ struct MathItalicsCorrectionInfo * from the beginning of * MathItalicsCorrectionInfo * table. */ - ArrayOf italicsCorrection; /* Array of MathValueRecords + Array16Of italicsCorrection; /* Array of MathValueRecords * defining italics correction * values for each * covered glyph. */ @@ -218,7 +218,7 @@ struct MathTopAccentAttachment * from the beginning of * MathTopAccentAttachment * table. */ - ArrayOf topAccentAttachment; /* Array of MathValueRecords + Array16Of topAccentAttachment; /* Array of MathValueRecords * defining top accent * attachment points for each * covered glyph. */ @@ -351,7 +351,7 @@ struct MathKernInfo /* Offset to Coverage table - * from the beginning of the * MathKernInfo table. */ - ArrayOf + Array16Of mathKernInfoRecords; /* Array of MathKernInfoRecords, * per-glyph information for @@ -532,7 +532,7 @@ struct MathGlyphAssembly /* Italics correction of this * MathGlyphAssembly. Should not * depend on the assembly size. */ - ArrayOf + Array16Of partRecords; /* Array of part records, from * left to right and bottom to * top. */ @@ -575,7 +575,7 @@ struct MathGlyphConstruction Offset16To glyphAssembly; /* MathGlyphVariantRecords for alternative variants of the glyphs. */ - ArrayOf mathGlyphVariantRecord; + Array16Of mathGlyphVariantRecord; public: DEFINE_SIZE_ARRAY (4, mathGlyphVariantRecord); diff --git a/src/hb-ot-post-table.hh b/src/hb-ot-post-table.hh index f22d6e244..d14626494 100644 --- a/src/hb-ot-post-table.hh +++ b/src/hb-ot-post-table.hh @@ -56,7 +56,7 @@ struct postV2Tail } protected: - ArrayOf glyphNameIndex; /* This is not an offset, but is the + Array16Of glyphNameIndex; /* This is not an offset, but is the * ordinal number of the glyph in 'post' * string tables. */ /*UnsizedArrayOf @@ -236,7 +236,7 @@ struct post private: uint32_t version; - const ArrayOf *glyphNameIndex; + const Array16Of *glyphNameIndex; hb_vector_t index_to_offset; const uint8_t *pool; hb_atomic_ptr_t gids_sorted_by_name; diff --git a/src/hb-ot-shape-complex-arabic-fallback.hh b/src/hb-ot-shape-complex-arabic-fallback.hh index ab91de27a..a04011902 100644 --- a/src/hb-ot-shape-complex-arabic-fallback.hh +++ b/src/hb-ot-shape-complex-arabic-fallback.hh @@ -212,7 +212,7 @@ struct ManifestLookup public: DEFINE_SIZE_STATIC (6); }; -typedef OT::ArrayOf Manifest; +typedef OT::Array16Of Manifest; static bool arabic_fallback_plan_init_win1256 (arabic_fallback_plan_t *fallback_plan HB_UNUSED, diff --git a/src/hb-ot-var-avar-table.hh b/src/hb-ot-var-avar-table.hh index 29219adb0..65f26c1d2 100644 --- a/src/hb-ot-var-avar-table.hh +++ b/src/hb-ot-var-avar-table.hh @@ -58,7 +58,7 @@ struct AxisValueMap DEFINE_SIZE_STATIC (4); }; -struct SegmentMaps : ArrayOf +struct SegmentMaps : Array16Of { int map (int value, unsigned int from_offset = 0, unsigned int to_offset = 1) const {