From 8e875770a05a55eb6f3948894eb5fc3aaaa6704b Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sat, 20 Oct 2018 07:22:17 +0000 Subject: harfbuzz 2.0.1 git-svn-id: svn://tug.org/texlive/trunk@48954 c570f23f-e606-0410-a88d-b1316a301751 --- .../libs/harfbuzz/harfbuzz-src/src/Makefile.am | 4 +- .../harfbuzz-src/src/hb-aat-layout-ankr-table.hh | 6 ++- .../harfbuzz-src/src/hb-aat-layout-common.hh | 55 ++++++++++++++++++++-- .../harfbuzz-src/src/hb-aat-layout-kerx-table.hh | 45 +++++++++++++----- .../harfbuzz-src/src/hb-aat-layout-trak-table.hh | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-common.cc | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc | 4 +- .../libs/harfbuzz/harfbuzz-src/src/hb-font.cc | 20 +++++--- .../libs/harfbuzz/harfbuzz-src/src/hb-font.hh | 8 ++++ .../libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh | 6 ++- .../libs/harfbuzz/harfbuzz-src/src/hb-map.hh | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-null.hh | 4 +- .../libs/harfbuzz/harfbuzz-src/src/hb-open-file.hh | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-open-type.hh | 3 ++ .../harfbuzz-src/src/hb-ot-layout-common.hh | 10 ++-- .../harfbuzz-src/src/hb-ot-layout-gdef-table.hh | 2 +- .../harfbuzz-src/src/hb-ot-layout-gpos-table.hh | 2 +- .../harfbuzz-src/src/hb-ot-layout-gsub-table.hh | 2 +- .../harfbuzz-src/src/hb-ot-layout-gsubgpos.hh | 6 +-- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.cc | 2 +- .../harfbuzz-src/src/hb-ot-var-hvar-table.hh | 2 +- .../harfbuzz-src/src/hb-ot-var-mvar-table.hh | 2 +- .../harfbuzz/harfbuzz-src/src/hb-shape-plan.cc | 8 ++-- 23 files changed, 146 insertions(+), 53 deletions(-) (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src') diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am index c74bab5d9e7..e0ea1c5de1f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am @@ -269,7 +269,7 @@ EXTRA_DIST += \ CLEANFILES += $(pkgconfig_DATA) -DEF_FILES = harfbuzz.def harfbuzz-subset.def harfbuzz-icu.def +DEF_FILES = harfbuzz.def harfbuzz-subset.def harfbuzz-icu.def harfbuzz-deprecated.def if HAVE_GOBJECT DEF_FILES += harfbuzz-gobject.def endif @@ -283,6 +283,8 @@ harfbuzz-icu.def: $(HB_ICU_headers) $(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^ harfbuzz-gobject.def: $(HB_GOBJECT_headers) $(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^ +harfbuzz-deprecated.def: $(srcdir)/hb-deprecated.h + $(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^ GENERATORS = \ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-ankr-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-ankr-table.hh index 2e3ed275851..5f7656d2a49 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-ankr-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-ankr-table.hh @@ -63,8 +63,10 @@ struct ankr unsigned int num_glyphs, const char *end) const { - unsigned int offset = (this+lookupTable).get_value_or_null (glyph_id, num_glyphs); - const GlyphAnchors &anchors = StructAtOffset (&(this+anchorData), offset); + const Offset *offset = (this+lookupTable).get_value (glyph_id, num_glyphs); + if (!offset) + return Null(Anchor); + const GlyphAnchors &anchors = StructAtOffset (&(this+anchorData), *offset); /* TODO Use sanitizer; to avoid overflows and more. */ if (unlikely ((const char *) &anchors + anchors.get_size () > end)) return Null(Anchor); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-common.hh index 89ed91f28a7..60724c180f6 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-common.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-common.hh @@ -246,6 +246,48 @@ struct LookupFormat8 DEFINE_SIZE_ARRAY (6, valueArrayZ); }; +template +struct LookupFormat10 +{ + friend struct Lookup; + + private: + inline const typename T::type get_value_or_null (hb_codepoint_t glyph_id) const + { + if (!(firstGlyph <= glyph_id && glyph_id - firstGlyph < glyphCount)) + return Null(T); + + const HBUINT8 *p = &valueArrayZ[(glyph_id - firstGlyph) * valueSize]; + + unsigned int v = 0; + unsigned int count = valueSize; + for (unsigned int i = 0; i < count; i++) + v = (v << 8) | *p++; + + return v; + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + valueSize <= 4 && + valueArrayZ.sanitize (c, glyphCount * valueSize)); + } + + protected: + HBUINT16 format; /* Format identifier--format = 8 */ + HBUINT16 valueSize; /* Byte size of each value. */ + GlyphID firstGlyph; /* First glyph index included in the trimmed array. */ + HBUINT16 glyphCount; /* Total number of glyphs (equivalent to the last + * glyph minus the value of firstGlyph plus 1). */ + UnsizedArrayOf + valueArrayZ; /* The lookup values (indexed by the glyph index + * minus the value of firstGlyph). */ + public: + DEFINE_SIZE_ARRAY (6, valueArrayZ); +}; + template struct Lookup { @@ -261,10 +303,15 @@ struct Lookup } } - inline const T& get_value_or_null (hb_codepoint_t glyph_id, unsigned int num_glyphs) const + inline const typename T::type get_value_or_null (hb_codepoint_t glyph_id, unsigned int num_glyphs) const { - const T *v = get_value (glyph_id, num_glyphs); - return v ? *v : Null(T); + switch (u.format) { + /* Format 10 cannot return a pointer. */ + case 10: return u.format10.get_value_or_null (glyph_id); + default: + const T *v = get_value (glyph_id, num_glyphs); + return v ? *v : Null(T); + } } inline bool sanitize (hb_sanitize_context_t *c) const @@ -277,6 +324,7 @@ struct Lookup case 4: return_trace (u.format4.sanitize (c)); case 6: return_trace (u.format6.sanitize (c)); case 8: return_trace (u.format8.sanitize (c)); + case 10: return_trace (u.format10.sanitize (c)); default:return_trace (true); } } @@ -289,6 +337,7 @@ struct Lookup LookupFormat4 format4; LookupFormat6 format6; LookupFormat8 format8; + LookupFormat10 format10; } u; public: DEFINE_SIZE_UNION (2, format); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-kerx-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-kerx-table.hh index c09a6d31075..6425780910b 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-kerx-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-kerx-table.hh @@ -45,6 +45,21 @@ namespace AAT { using namespace OT; +static inline int +kerxTupleKern (int value, + unsigned int tupleCount, + const void *base, + hb_aat_apply_context_t *c) +{ + if (likely (!tupleCount)) return value; + + unsigned int offset = value; + const FWORD *pv = &StructAtOffset (base, offset); + if (unlikely (!pv->sanitize (&c->sanitizer))) return 0; + return *pv; +} + + struct KerxSubTableHeader { inline bool sanitize (hb_sanitize_context_t *c) const @@ -65,6 +80,7 @@ struct KerxSubTableFormat0 { inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const { + if (header.tupleCount) return 0; /* TODO kerxTupleKern */ hb_glyph_pair_t pair = {left, right}; int i = pairs.bsearch (pair); return i == -1 ? 0 : pairs[i].get_kerning (); @@ -143,12 +159,12 @@ struct KerxSubTableFormat1 if (flags & Reset) { - depth = 0; + depth = 0; } if (flags & Push) { - if (likely (depth < ARRAY_LENGTH (stack))) + if (likely (depth < ARRAY_LENGTH (stack))) stack[depth++] = buffer->idx; else depth = 0; /* Probably not what CoreText does, but better? */ @@ -157,14 +173,14 @@ struct KerxSubTableFormat1 if (entry->data.kernActionIndex != 0xFFFF) { const FWORD *actions = &kernAction[entry->data.kernActionIndex]; - if (!c->sanitizer.check_array (actions, depth)) + if (!c->sanitizer.check_array (actions, depth)) { depth = 0; return false; } hb_mask_t kern_mask = c->plan->kern_mask; - for (unsigned int i = 0; i < depth; i++) + for (unsigned int i = 0; i < depth; i++) { /* Apparently, when spec says "Each pops one glyph from the kerning stack * and applies the kerning value to it.", it doesn't mean it in that order. @@ -201,6 +217,9 @@ struct KerxSubTableFormat1 if (!c->plan->requested_kerning) return false; + if (header.tupleCount) + return_trace (false); /* TODO kerxTupleKern */ + driver_context_t dc (this, c); StateTableDriver driver (machine, c->buffer, c->font->face); @@ -236,7 +255,7 @@ struct KerxSubTableFormat2 unsigned int offset = l + r; const FWORD *v = &StructAtOffset (&(this+array), offset); if (unlikely (!v->sanitize (&c->sanitizer))) return 0; - return *v; + return kerxTupleKern (*v, header.tupleCount, this, c); } inline bool apply (hb_aat_apply_context_t *c) const @@ -482,7 +501,7 @@ struct KerxSubTableFormat6 if (unlikely (hb_unsigned_mul_overflows (offset, sizeof (FWORD32)))) return 0; const FWORD32 *v = &StructAtOffset (&(this+t.array), offset * sizeof (FWORD32)); if (unlikely (!v->sanitize (&c->sanitizer))) return 0; - return *v; + return kerxTupleKern (*v, header.tupleCount, &(this+vector), c); } else { @@ -492,7 +511,7 @@ struct KerxSubTableFormat6 unsigned int offset = l + r; const FWORD *v = &StructAtOffset (&(this+t.array), offset * sizeof (FWORD)); if (unlikely (!v->sanitize (&c->sanitizer))) return 0; - return *v; + return kerxTupleKern (*v, header.tupleCount, &(this+vector), c); } } @@ -523,7 +542,9 @@ struct KerxSubTableFormat6 u.s.rowIndexTable.sanitize (c, this) && u.s.columnIndexTable.sanitize (c, this) && c->check_range (this, u.s.array) - )))); + )) && + (header.tupleCount == 0 || + c->check_range (this, vector)))); } struct accelerator_t @@ -559,8 +580,9 @@ struct KerxSubTableFormat6 LOffsetTo, false> array; } s; } u; + LOffsetTo, false> vector; public: - DEFINE_SIZE_STATIC (32); + DEFINE_SIZE_STATIC (36); }; struct KerxTable @@ -642,9 +664,8 @@ struct kerx { bool reverse; - if (table->u.header.coverage & (KerxTable::CrossStream | KerxTable::Variation) || - table->u.header.tupleCount) - goto skip; /* We do NOT handle cross-stream or variation kerning. */ + if (table->u.header.coverage & (KerxTable::CrossStream)) + goto skip; /* We do NOT handle cross-stream. */ if (HB_DIRECTION_IS_VERTICAL (c->buffer->props.direction) != bool (table->u.header.coverage & KerxTable::Vertical)) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-trak-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-trak-table.hh index 4b4bc2ffeee..16729d16f5c 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-trak-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-trak-table.hh @@ -136,7 +136,7 @@ struct TrackData /* TODO bfind() */ hb_array_t size_table ((base+sizeTable).arrayZ, sizes); unsigned int size_index; - for (size_index = 0; size_index < sizes; size_index++) + for (size_index = 0; size_index < sizes - 1; size_index++) if (size_table[size_index].to_float () >= csspx) break; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc index 4940e7fb561..ba48dd56106 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc @@ -45,7 +45,7 @@ _hb_options_init (void) { hb_options_union_t u; u.i = 0; - u.opts.initialized = 1; + u.opts.initialized = true; const char *c = getenv ("HB_OPTIONS"); if (c) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc index aa3921a3fdd..9f7745dbf88 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc @@ -643,7 +643,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, CFStringRef string_ref = nullptr; CTLineRef line = nullptr; - if (0) + if (false) { resize_and_retry: DEBUG_MSG (CORETEXT, buffer, "Buffer resize"); @@ -1054,7 +1054,7 @@ resize_and_retry: * * https://crbug.com/419769 */ - if (0) + if (false) { /* Make sure all runs had the expected direction. */ bool backward = HB_DIRECTION_IS_BACKWARD (buffer->props.direction); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc index 7a430237c73..b6b668dd8bc 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc @@ -103,7 +103,7 @@ hb_font_get_nominal_glyph_default (hb_font_t *font, hb_codepoint_t *glyph, void *user_data HB_UNUSED) { - if (font->has_nominal_glyphs_func ()) + if (font->has_nominal_glyphs_func_set ()) { return font->get_nominal_glyphs (1, &unicode, 0, glyph, 0); } @@ -121,7 +121,7 @@ hb_font_get_nominal_glyphs_default (hb_font_t *font, unsigned int glyph_stride, void *user_data HB_UNUSED) { - if (font->has_nominal_glyph_func ()) + if (font->has_nominal_glyph_func_set ()) { for (unsigned int i = 0; i < count; i++) { @@ -176,7 +176,7 @@ hb_font_get_glyph_h_advance_default (hb_font_t *font, hb_codepoint_t glyph, void *user_data HB_UNUSED) { - if (font->has_glyph_h_advances_func ()) + if (font->has_glyph_h_advances_func_set ()) { hb_position_t ret; font->get_glyph_h_advances (1, &glyph, 0, &ret, 0); @@ -200,7 +200,7 @@ hb_font_get_glyph_v_advance_default (hb_font_t *font, hb_codepoint_t glyph, void *user_data HB_UNUSED) { - if (font->has_glyph_v_advances_func ()) + if (font->has_glyph_v_advances_func_set ()) { hb_position_t ret; font->get_glyph_v_advances (1, &glyph, 0, &ret, 0); @@ -220,7 +220,7 @@ hb_font_get_glyph_h_advances_default (hb_font_t* font, unsigned int advance_stride, void *user_data HB_UNUSED) { - if (font->has_glyph_h_advance_func ()) + if (font->has_glyph_h_advance_func_set ()) { for (unsigned int i = 0; i < count; i++) { @@ -252,7 +252,7 @@ hb_font_get_glyph_v_advances_default (hb_font_t* font, unsigned int advance_stride, void *user_data HB_UNUSED) { - if (font->has_glyph_v_advance_func ()) + if (font->has_glyph_v_advance_func_set ()) { for (unsigned int i = 0; i < count; i++) { @@ -687,10 +687,16 @@ hb_font_funcs_set_##name##_func (hb_font_funcs_t *ffuncs, \ HB_FONT_FUNCS_IMPLEMENT_CALLBACKS #undef HB_FONT_FUNC_IMPLEMENT +bool +hb_font_t::has_func_set (unsigned int i) +{ + return this->klass->get.array[i] != _hb_font_funcs_default.get.array[i]; +} + bool hb_font_t::has_func (unsigned int i) { - return (this->klass->get.array[i] != _hb_font_funcs_default.get.array[i]) || + return has_func_set (i) || (parent && parent != &_hb_Null_hb_font_t && parent->has_func (i)); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh index e10d56745fc..2df5e42ee6f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh @@ -171,6 +171,7 @@ struct hb_font_t /* Public getters */ HB_INTERNAL bool has_func (unsigned int i); + HB_INTERNAL bool has_func_set (unsigned int i); /* has_* ... */ #define HB_FONT_FUNC_IMPLEMENT(name) \ @@ -180,6 +181,13 @@ struct hb_font_t hb_font_funcs_t *funcs = this->klass; \ unsigned int i = offsetof (hb_font_funcs_t::get_t::get_funcs_t, name) / sizeof (funcs->get.array[0]); \ return has_func (i); \ + } \ + bool \ + has_##name##_func_set (void) \ + { \ + hb_font_funcs_t *funcs = this->klass; \ + unsigned int i = offsetof (hb_font_funcs_t::get_t::get_funcs_t, name) / sizeof (funcs->get.array[0]); \ + return has_func_set (i); \ } HB_FONT_FUNCS_IMPLEMENT_CALLBACKS #undef HB_FONT_FUNC_IMPLEMENT diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh index d836a94d629..ae34c92f458 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh @@ -204,7 +204,7 @@ struct hb_dispatch_context_t * The same argument can be made re GSUB/GPOS/GDEF, but there, the table * structure is so complicated that by checking all offsets at sanitize() time, * we make the code much simpler in other methods, as offsets and referenced - * objectes do not need to be validated at each use site. + * objects do not need to be validated at each use site. */ /* This limits sanitizing time on really broken fonts. */ @@ -652,6 +652,7 @@ template struct BEInt { public: + typedef Type type; inline void set (Type V) { v = V; @@ -666,6 +667,7 @@ template struct BEInt { public: + typedef Type type; inline void set (Type V) { v[0] = (V >> 8) & 0xFF; @@ -682,6 +684,7 @@ template struct BEInt { public: + typedef Type type; inline void set (Type V) { v[0] = (V >> 16) & 0xFF; @@ -700,6 +703,7 @@ template struct BEInt { public: + typedef Type type; inline void set (Type V) { v[0] = (V >> 24) & 0xFF; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.hh index 21898a7a677..b55e3a9543e 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.hh @@ -172,7 +172,7 @@ struct hb_map_t inline bool is_empty (void) const { - return population != 0; + return population == 0; } inline unsigned int get_population () const diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-null.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-null.hh index bf01b3af741..87662265cf0 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-null.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-null.hh @@ -49,7 +49,7 @@ static inline Type const & Null (void) { } #define Null(Type) Null() -/* Specializaitons for arbitrary-content Null objects expressed in bytes. */ +/* Specializations for arbitrary-content Null objects expressed in bytes. */ #define DECLARE_NULL_NAMESPACE_BYTES(Namespace, Type) \ } /* Close namespace. */ \ extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::min_size]; \ @@ -62,7 +62,7 @@ static inline Type const & Null (void) { #define DEFINE_NULL_NAMESPACE_BYTES(Namespace, Type) \ const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::min_size] -/* Specializaitons for arbitrary-content Null objects expressed as struct initializer. */ +/* Specializations for arbitrary-content Null objects expressed as struct initializer. */ #define DECLARE_NULL_INSTANCE(Type) \ extern HB_INTERNAL const Type _hb_Null_##Type; \ template <> \ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-file.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-file.hh index 8772c79fa10..817791ab083 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-file.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-file.hh @@ -160,7 +160,7 @@ typedef struct OffsetTable memcpy (start, hb_blob_get_data (blob, nullptr), rec.length); - /* 4-byte allignment. */ + /* 4-byte alignment. */ c->align (4); const char *end = (const char *) c->head; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type.hh index 9d2e1fa7c1d..08e72064af8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type.hh @@ -56,6 +56,7 @@ namespace OT { template struct IntType { + typedef Type type; inline void set (Type i) { v.set (i); } inline operator Type(void) const { return v; } inline bool operator == (const IntType &o) const { return (Type) v == (Type) o.v; } @@ -161,6 +162,8 @@ DECLARE_NULL_NAMESPACE_BYTES (OT, Index); template struct Offset : Type { + typedef Type type; + inline bool is_null (void) const { return has_null && 0 == *this; } inline void *serialize (hb_serialize_context_t *c, const void *base) 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 0c60a1304e2..98f6a079fac 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 @@ -718,7 +718,7 @@ struct Lookup return_trace (true); } - /* Older compileres need this to NOT be locally defined in a function. */ + /* Older compilers need this to NOT be locally defined in a function. */ template struct SubTableSubsetWrapper { @@ -1475,7 +1475,7 @@ struct VarRegionAxis struct VarRegionList { inline float evaluate (unsigned int region_index, - int *coords, unsigned int coord_len) const + const int *coords, unsigned int coord_len) const { if (unlikely (region_index >= regionCount)) return 0.; @@ -1520,7 +1520,7 @@ struct VarData { return itemCount * get_row_size (); } inline float get_delta (unsigned int inner, - int *coords, unsigned int coord_count, + const int *coords, unsigned int coord_count, const VarRegionList ®ions) const { if (unlikely (inner >= itemCount)) @@ -1573,7 +1573,7 @@ struct VarData struct VariationStore { inline float get_delta (unsigned int outer, unsigned int inner, - int *coords, unsigned int coord_count) const + const int *coords, unsigned int coord_count) const { if (unlikely (outer >= dataSets.len)) return 0.; @@ -1584,7 +1584,7 @@ struct VariationStore } inline float get_delta (unsigned int index, - int *coords, unsigned int coord_count) const + const int *coords, unsigned int coord_count) const { unsigned int outer = index >> 16; unsigned int inner = index & 0xFFFF; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh index cad99a3d62e..757090861b0 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh @@ -388,7 +388,7 @@ struct GDEF { return version.to_int () >= 0x00010003u ? this+varStore : Null(VariationStore); } /* glyph_props is a 16-bit integer where the lower 8-bit have bits representing - * glyph class and other bits, and high 8-bit gthe mark attachment type (if any). + * glyph class and other bits, and high 8-bit the mark attachment type (if any). * Not to be confused with lookup_props which is very similar. */ inline unsigned int get_glyph_props (hb_codepoint_t glyph) const { diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gpos-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gpos-table.hh index 4f81b32785e..dad6c4ea93f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gpos-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gpos-table.hh @@ -1164,7 +1164,7 @@ struct MarkBasePosFormat1 )) break; skippy_iter.reject (); - } while (1); + } while (true); /* Checking that matched glyph is actually a base glyph by GDEF is too strong; disabled */ //if (!_hb_glyph_info_is_base_glyph (&buffer->info[skippy_iter.idx])) { return_trace (false); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsub-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsub-table.hh index b664f15a617..2ce52a1b494 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsub-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsub-table.hh @@ -103,7 +103,7 @@ struct SingleSubstFormat1 TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return_trace (false); - deltaGlyphID.set (delta); /* TODO(serilaize) overflow? */ + deltaGlyphID.set (delta); /* TODO(serialize) overflow? */ return_trace (true); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh index 695a5df9957..a4066265c77 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh @@ -199,8 +199,6 @@ struct hb_collect_glyphs_context_t : after = old_after; recursed_lookups->add (lookup_index); - - return; } hb_face_t *face; @@ -582,7 +580,7 @@ struct hb_ot_apply_context_t : add_in |= HB_OT_LAYOUT_GLYPH_PROPS_LIGATED; /* In the only place that the MULTIPLIED bit is used, Uniscribe * seems to only care about the "last" transformation between - * Ligature and Multiple substitions. Ie. if you ligate, expand, + * Ligature and Multiple substitutions. Ie. if you ligate, expand, * and ligate again, it forgives the multiplication and acts as * if only ligation happened. As such, clear MULTIPLIED bit. */ @@ -903,7 +901,7 @@ static inline bool match_input (hb_ot_apply_context_t *c, } static inline bool ligate_input (hb_ot_apply_context_t *c, unsigned int count, /* Including the first glyph */ - unsigned int match_positions[HB_MAX_CONTEXT_LENGTH], /* Including the first glyph */ + const unsigned int match_positions[HB_MAX_CONTEXT_LENGTH], /* Including the first glyph */ unsigned int match_length, hb_codepoint_t lig_glyph, unsigned int total_component_count) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.cc index 3d4e8b06612..4dba9c31a18 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.cc @@ -201,7 +201,7 @@ subtag_matches (const char *lang_str, if (!ISALNUM (s[strlen (subtag)])) return true; lang_str = s + strlen (subtag); - } while (1); + } while (true); } static hb_bool_t diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-hvar-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-hvar-table.hh index d87285b7f5d..66e086e1d95 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-hvar-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-hvar-table.hh @@ -115,7 +115,7 @@ struct HVARVVAR } inline float get_advance_var (hb_codepoint_t glyph, - int *coords, unsigned int coord_count) const + const int *coords, unsigned int coord_count) const { unsigned int varidx = (this+advMap).map (glyph); return (this+varStore).get_delta (varidx, coords, coord_count); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-mvar-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-mvar-table.hh index d60c6b910e9..5d6b559541e 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-mvar-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-mvar-table.hh @@ -72,7 +72,7 @@ struct MVAR } inline float get_var (hb_tag_t tag, - int *coords, unsigned int coord_count) const + const int *coords, unsigned int coord_count) const { const VariationValueRecord *record; record = (VariationValueRecord *) bsearch (&tag, valuesZ.arrayZ, diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc index b0cf1e92d1d..b2289f86994 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc @@ -64,7 +64,7 @@ hb_shape_plan_plan (hb_shape_plan_t *shape_plan, if (likely (!shaper_list)) { for (unsigned int i = 0; i < HB_SHAPERS_COUNT; i++) - if (0) + if (false) ; #define HB_SHAPER_IMPLEMENT(shaper) \ else if (shapers[i].func == _hb_##shaper##_shape) \ @@ -73,7 +73,7 @@ hb_shape_plan_plan (hb_shape_plan_t *shape_plan, #undef HB_SHAPER_IMPLEMENT } else { for (; *shaper_list; shaper_list++) - if (0) + if (false) ; #define HB_SHAPER_IMPLEMENT(shaper) \ else if (0 == strcmp (*shaper_list, #shaper)) \ @@ -346,7 +346,7 @@ hb_shape_plan_execute (hb_shape_plan_t *shape_plan, _hb_##shaper##_shape (shape_plan, font, buffer, features, num_features); \ } HB_STMT_END - if (0) + if (false) ; #define HB_SHAPER_IMPLEMENT(shaper) \ else if (shape_plan->shaper_func == _hb_##shaper##_shape) \ @@ -501,7 +501,7 @@ hb_shape_plan_create_cached2 (hb_face_t *face, /* Choose shaper. Adapted from hb_shape_plan_plan(). * Must choose shaper exactly the same way as that function. */ for (const char * const *shaper_item = shaper_list; *shaper_item; shaper_item++) - if (0) + if (false) ; #define HB_SHAPER_IMPLEMENT(shaper) \ else if (0 == strcmp (*shaper_item, #shaper) && \ -- cgit v1.2.3