diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common.hh')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common.hh | 82 |
1 files changed, 38 insertions, 44 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common.hh index 7b1d39aa0c6..55b05b5136d 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common.hh @@ -131,8 +131,8 @@ struct RecordArrayOf : SortedArrayOf<Record<Type> > /* If we want to allow non-sorted data, we can lsearch(). */ int i = this->/*lsearch*/bsearch (tag); if (i != -1) { - if (index) *index = i; - return true; + if (index) *index = i; + return true; } else { if (index) *index = Index::NOT_FOUND_INDEX; return false; @@ -526,21 +526,21 @@ struct FeatureParams { if (tag == HB_TAG ('s','i','z','e')) return u.size; - return Null(FeatureParamsSize); + return Null (FeatureParamsSize); } inline const FeatureParamsStylisticSet& get_stylistic_set_params (hb_tag_t tag) const { if ((tag & 0xFFFF0000u) == HB_TAG ('s','s','\0','\0')) /* ssXX */ return u.stylisticSet; - return Null(FeatureParamsStylisticSet); + return Null (FeatureParamsStylisticSet); } inline const FeatureParamsCharacterVariants& get_character_variants_params (hb_tag_t tag) const { if ((tag & 0xFFFF0000u) == HB_TAG ('c','v','\0','\0')) /* cvXX */ return u.characterVariants; - return Null(FeatureParamsCharacterVariants); + return Null (FeatureParamsCharacterVariants); } private: @@ -704,7 +704,7 @@ struct Lookup for (unsigned int i = 0; i < count; i++) { typename context_t::return_t r = get_subtable<TSubTable> (i).dispatch (c, lookup_type); if (c->stop_sublookup_iteration (r)) - return_trace (r); + return_trace (r); } return_trace (c->default_return_value ()); } @@ -790,7 +790,7 @@ struct Lookup unsigned int type = get_subtable<TSubTable> (0).u.extension.get_type (); unsigned int count = get_subtable_count (); for (unsigned int i = 1; i < count; i++) - if (get_subtable<TSubTable> (i).u.extension.get_type () != type) + if (get_subtable<TSubTable> (i).u.extension.get_type () != type) return_trace (false); } return_trace (true); @@ -854,7 +854,7 @@ struct CoverageFormat1 unsigned int count = glyphArray.len; for (unsigned int i = 0; i < count; i++) if (glyphs->has (glyphArray[i])) - return true; + return true; return false; } inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const @@ -920,7 +920,7 @@ struct CoverageFormat2 unsigned int num_ranges = 1; for (unsigned int i = 1; i < num_glyphs; i++) if (glyphs[i - 1] + 1 != glyphs[i]) - num_ranges++; + num_ranges++; rangeRecord.len.set (num_ranges); if (unlikely (!c->extend (rangeRecord))) return_trace (false); @@ -932,9 +932,9 @@ struct CoverageFormat2 range++; rangeRecord[range].start = glyphs[i]; rangeRecord[range].value.set (i); - rangeRecord[range].end = glyphs[i]; + rangeRecord[range].end = glyphs[i]; } else { - rangeRecord[range].end = glyphs[i]; + rangeRecord[range].end = glyphs[i]; } glyphs += num_glyphs; return_trace (true); @@ -952,7 +952,7 @@ struct CoverageFormat2 unsigned int count = rangeRecord.len; for (unsigned int i = 0; i < count; i++) if (rangeRecord[i].intersects (glyphs)) - return true; + return true; return false; } inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const @@ -964,9 +964,9 @@ struct CoverageFormat2 if (range.value <= index && index < (unsigned int) range.value + (range.end - range.start) && range.intersects (glyphs)) - return true; + return true; else if (index < range.value) - return false; + return false; } return false; } @@ -976,7 +976,7 @@ struct CoverageFormat2 unsigned int count = rangeRecord.len; for (unsigned int i = 0; i < count; i++) if (unlikely (!rangeRecord[i].add_coverage (glyphs))) - return false; + return false; return true; } @@ -992,8 +992,8 @@ struct CoverageFormat2 j = c->rangeRecord.len ? c->rangeRecord[0].start : 0; if (unlikely (c->rangeRecord[0].start > c->rangeRecord[0].end)) { - /* Broken table. Skip. */ - i = c->rangeRecord.len; + /* Broken table. Skip. */ + i = c->rangeRecord.len; } } inline void fini (void) {} @@ -1002,7 +1002,7 @@ struct CoverageFormat2 { if (j >= c->rangeRecord[i].end) { - i++; + i++; if (more ()) { hb_codepoint_t old = j; @@ -1060,7 +1060,7 @@ struct Coverage unsigned int num_ranges = 1; for (unsigned int i = 1; i < num_glyphs; i++) if (glyphs[i - 1] + 1 != glyphs[i]) - num_ranges++; + num_ranges++; u.format.set (num_glyphs * 2 < num_ranges * 3 ? 1 : 2); switch (u.format) { @@ -1213,7 +1213,7 @@ struct ClassDefFormat1 for (unsigned int i = 0; i < count; i++) { if (classValue[i]) - continue; + continue; if (start != i) if (unlikely (!glyphs->add_range (startGlyph + start, startGlyph + i))) @@ -1232,10 +1232,7 @@ struct ClassDefFormat1 inline bool add_class (set_t *glyphs, unsigned int klass) const { unsigned int count = classValue.len; for (unsigned int i = 0; i < count; i++) - { - if (classValue[i] == klass) - glyphs->add (startGlyph + i); - } + if (classValue[i] == klass) glyphs->add (startGlyph + i); return true; } @@ -1246,8 +1243,7 @@ struct ClassDefFormat1 hb_codepoint_t end = startGlyph + classValue.len; for (hb_codepoint_t iter = startGlyph - 1; hb_set_next (glyphs, &iter) && iter < end;) - if (classValue[iter - start]) - return true; + if (classValue[iter - start]) return true; return false; } inline bool intersects_class (const hb_set_t *glyphs, unsigned int klass) const { @@ -1256,18 +1252,15 @@ struct ClassDefFormat1 { /* Match if there's any glyph that is not listed! */ hb_codepoint_t g = HB_SET_VALUE_INVALID; - if (!hb_set_next (glyphs, &g)) - return false; - if (g < startGlyph) - return true; + if (!hb_set_next (glyphs, &g)) return false; + if (g < startGlyph) return true; g = startGlyph + count - 1; - if (hb_set_next (glyphs, &g)) - return true; + if (hb_set_next (glyphs, &g)) return true; /* Fall through. */ } for (unsigned int i = 0; i < count; i++) if (classValue[i] == klass && glyphs->has (startGlyph + i)) - return true; + return true; return false; } @@ -1317,7 +1310,7 @@ struct ClassDefFormat2 for (unsigned int i = 0; i < count; i++) { if (rangeRecord[i].value == klass) - if (unlikely (!rangeRecord[i].add_coverage (glyphs))) + if (unlikely (!rangeRecord[i].add_coverage (glyphs))) return false; } return true; @@ -1329,7 +1322,7 @@ struct ClassDefFormat2 unsigned int count = rangeRecord.len; for (unsigned int i = 0; i < count; i++) if (rangeRecord[i].intersects (glyphs)) - return true; + return true; return false; } inline bool intersects_class (const hb_set_t *glyphs, unsigned int klass) const @@ -1348,12 +1341,12 @@ struct ClassDefFormat2 g = rangeRecord[i].end; } if (g != HB_SET_VALUE_INVALID && hb_set_next (glyphs, &g)) - return true; + return true; /* Fall through. */ } for (unsigned int i = 0; i < count; i++) if (rangeRecord[i].value == klass && rangeRecord[i].intersects (glyphs)) - return true; + return true; return false; } @@ -1498,7 +1491,7 @@ struct VarRegionList int coord = i < coord_len ? coords[i] : 0; float factor = axes[i].evaluate (coord); if (factor == 0.f) - return 0.; + return 0.; v *= factor; } return v; @@ -1564,10 +1557,11 @@ struct VarData { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && - regionIndices.sanitize(c) && + regionIndices.sanitize (c) && shortCount <= regionIndices.len && - c->check_array (&StructAfter<HBUINT8> (regionIndices), - itemCount, get_row_size ())); + c->check_range (&StructAfter<HBUINT8> (regionIndices), + itemCount, + get_row_size ())); } protected: @@ -1683,7 +1677,7 @@ struct ConditionSet unsigned int count = conditions.len; for (unsigned int i = 0; i < count; i++) if (!(this+conditions.arrayZ[i]).evaluate (coords, coord_len)) - return false; + return false; return true; } @@ -1941,7 +1935,7 @@ struct DeviceHeader struct Device { - inline hb_position_t get_x_delta (hb_font_t *font, const VariationStore &store=Null(VariationStore)) const + inline hb_position_t get_x_delta (hb_font_t *font, const VariationStore &store=Null (VariationStore)) const { switch (u.b.format) { @@ -1953,7 +1947,7 @@ struct Device return 0; } } - inline hb_position_t get_y_delta (hb_font_t *font, const VariationStore &store=Null(VariationStore)) const + inline hb_position_t get_y_delta (hb_font_t *font, const VariationStore &store=Null (VariationStore)) const { switch (u.b.format) { |