diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 6220501e3..ab25e9671 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -891,7 +891,7 @@ struct ArrayOfM1 }; /* An array with sorted elements. Supports binary searching. */ -template +template struct SortedArrayOf : ArrayOf { hb_sorted_array_t< Type> as_array () { return hb_sorted_array (this->arrayZ, this->len); } @@ -942,6 +942,9 @@ struct SortedArrayOf : ArrayOf { return as_array ().bfind (x, i, not_found, to_store); } }; +template using SortedArray16Of = SortedArrayOf; +template using SortedArray32Of = SortedArrayOf; + /* * Binary-search arrays */ diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index aaad14d38..1e2f98f27 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -672,7 +672,7 @@ struct CmapSubtableLongSegmented HBUINT16 reserved; /* Reserved; set to 0. */ HBUINT32 length; /* Byte length of this subtable. */ HBUINT32 language; /* Ignore. */ - SortedArrayOf + SortedArray32Of groups; /* Groupings. */ public: DEFINE_SIZE_ARRAY (16, groups); @@ -786,7 +786,7 @@ struct UnicodeValueRange DEFINE_SIZE_STATIC (4); }; -struct DefaultUVS : SortedArrayOf +struct DefaultUVS : SortedArray32Of { void collect_unicodes (hb_set_t *out) const { @@ -880,7 +880,7 @@ struct UVSMapping DEFINE_SIZE_STATIC (5); }; -struct NonDefaultUVS : SortedArrayOf +struct NonDefaultUVS : SortedArray32Of { void collect_unicodes (hb_set_t *out) const { @@ -1186,7 +1186,7 @@ struct CmapSubtableFormat14 protected: HBUINT16 format; /* Format number is set to 14. */ HBUINT32 length; /* Byte length of this subtable. */ - SortedArrayOf + SortedArray32Of record; /* Variation selector records; sorted * in increasing order of `varSelector'. */ public: @@ -1705,7 +1705,7 @@ struct cmap protected: HBUINT16 version; /* Table version number (0). */ - SortedArrayOf + SortedArray16Of encodingRecord; /* Encoding tables. */ public: DEFINE_SIZE_ARRAY (4, encodingRecord); diff --git a/src/hb-ot-color-svg-table.hh b/src/hb-ot-color-svg-table.hh index 04fbf8997..e022ef43b 100644 --- a/src/hb-ot-color-svg-table.hh +++ b/src/hb-ot-color-svg-table.hh @@ -107,7 +107,7 @@ struct SVG protected: HBUINT16 version; /* Table version (starting at 0). */ - Offset32To> + Offset32To> svgDocEntries; /* Offset (relative to the start of the SVG table) to the * SVG Documents Index. Must be non-zero. */ /* Array of SVG Document Index Entries. */ diff --git a/src/hb-ot-layout-base-table.hh b/src/hb-ot-layout-base-table.hh index 47eafa3a1..492947751 100644 --- a/src/hb-ot-layout-base-table.hh +++ b/src/hb-ot-layout-base-table.hh @@ -220,7 +220,7 @@ struct MinMax maxCoord; /* Offset to BaseCoord table that defines * maximum extent value, from the beginning * of MinMax table (may be NULL) */ - SortedArrayOf + SortedArray16Of featMinMaxRecords; /* Array of FeatMinMaxRecords, in alphabetical * order by featureTableTag */ @@ -311,7 +311,7 @@ struct BaseScript Offset16To defaultMinMax; /* Offset to MinMax table, from beginning of * BaseScript table (may be NULL) */ - SortedArrayOf + SortedArray16Of baseLangSysRecords; /* Number of BaseLangSysRecords * defined — may be zero (0) */ @@ -364,7 +364,7 @@ struct BaseScriptList } protected: - SortedArrayOf + SortedArray16Of baseScriptRecords; public: @@ -426,7 +426,7 @@ struct Axis } protected: - Offset16To> + Offset16To> baseTagList; /* Offset to BaseTagList table, from beginning * of Axis table (may be NULL) * Array of 4-byte baseline identification tags — must diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 05889ef08..60da8087f 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -392,7 +392,7 @@ struct Record }; template -struct RecordArrayOf : SortedArrayOf> +struct RecordArrayOf : SortedArray16Of> { const Offset16To& get_offset (unsigned int i) const { return (*this)[i].offset; } @@ -1447,7 +1447,7 @@ struct CoverageFormat1 protected: HBUINT16 coverageFormat; /* Format identifier--format = 1 */ - SortedArrayOf + SortedArray16Of glyphArray; /* Array of GlyphIDs--in numerical order */ public: DEFINE_SIZE_ARRAY (4, glyphArray); @@ -1623,7 +1623,7 @@ struct CoverageFormat2 protected: HBUINT16 coverageFormat; /* Format identifier--format = 2 */ - SortedArrayOf + SortedArray16Of rangeRecord; /* Array of glyph ranges--ordered by * Start GlyphID. rangeCount entries * long */ @@ -2274,7 +2274,7 @@ struct ClassDefFormat2 protected: HBUINT16 classFormat; /* Format identifier--format = 2 */ - SortedArrayOf + SortedArray16Of rangeRecord; /* Array of glyph ranges--ordered by * Start GlyphID */ public: diff --git a/src/hb-ot-layout-jstf-table.hh b/src/hb-ot-layout-jstf-table.hh index 92e684bce..3b2293dff 100644 --- a/src/hb-ot-layout-jstf-table.hh +++ b/src/hb-ot-layout-jstf-table.hh @@ -136,7 +136,7 @@ struct JstfLangSys : List16OfOffset16To * ExtenderGlyphs -- Extender Glyph Table */ -typedef SortedArrayOf ExtenderGlyphs; +typedef SortedArray16Of ExtenderGlyphs; /* diff --git a/src/hb-ot-vorg-table.hh b/src/hb-ot-vorg-table.hh index c6803200f..efa7737d6 100644 --- a/src/hb-ot-vorg-table.hh +++ b/src/hb-ot-vorg-table.hh @@ -125,7 +125,7 @@ struct VORG FixedVersion<>version; /* Version of VORG table. Set to 0x00010000u. */ FWORD defaultVertOriginY; /* The default vertical origin. */ - SortedArrayOf + SortedArray16Of vertYOrigins; /* The array of vertical origins. */ public: