diff options
author | eae <eae@chromium.org> | 2015-08-20 19:57:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-21 02:57:41 +0000 |
commit | 81cabb22dd8708b3c629922858ba053c4d94e69e (patch) | |
tree | 56b7b5b4b339a510db7858891ce2fc12b6eff3e4 /third_party/harfbuzz-ng | |
parent | 22ab8eef999925ec4d1671935954080df7eb6e7c (diff) | |
download | chromium_src-81cabb22dd8708b3c629922858ba053c4d94e69e.zip chromium_src-81cabb22dd8708b3c629922858ba053c4d94e69e.tar.gz chromium_src-81cabb22dd8708b3c629922858ba053c4d94e69e.tar.bz2 |
Roll harfbuzz-ng to 1.0.2
Update the bundled version of harfbuzz-ng in third_party to 1.0.2 plus a
set of patches from the trunk version. This addresses an assert on older
MacOSX versions and fixes the bidi-neutral-run.html layout test failure.
Roll to commit ed6962c795ae7c54aaee9ed5667fa65ccf7412bf.
TBR=drott@chromium.org
BUG=517898
Review URL: https://codereview.chromium.org/1302973002
Cr-Commit-Position: refs/heads/master@{#344665}
Diffstat (limited to 'third_party/harfbuzz-ng')
-rw-r--r-- | third_party/harfbuzz-ng/NEWS | 13 | ||||
-rw-r--r-- | third_party/harfbuzz-ng/README.chromium | 4 | ||||
-rw-r--r-- | third_party/harfbuzz-ng/src/hb-buffer-serialize.cc | 6 | ||||
-rw-r--r-- | third_party/harfbuzz-ng/src/hb-coretext.cc | 39 | ||||
-rw-r--r-- | third_party/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh | 5 | ||||
-rw-r--r-- | third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh | 5 | ||||
-rw-r--r-- | third_party/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh | 7 | ||||
-rw-r--r-- | third_party/harfbuzz-ng/src/hb-ot-layout.cc | 15 | ||||
-rw-r--r-- | third_party/harfbuzz-ng/src/hb-ot-shape-fallback.cc | 5 | ||||
-rw-r--r-- | third_party/harfbuzz-ng/src/hb-ot-shape-normalize.cc | 2 | ||||
-rw-r--r-- | third_party/harfbuzz-ng/src/hb-ot-shape.cc | 2 | ||||
-rw-r--r-- | third_party/harfbuzz-ng/src/hb-version.h | 4 |
12 files changed, 78 insertions, 29 deletions
diff --git a/third_party/harfbuzz-ng/NEWS b/third_party/harfbuzz-ng/NEWS index ed67abf..67bef7f 100644 --- a/third_party/harfbuzz-ng/NEWS +++ b/third_party/harfbuzz-ng/NEWS @@ -1,3 +1,16 @@ +Overview of changes leading to 1.0.2 +Wednesday, August 19, 2015 +==================================== + +- Fix shaping with cluster-level > 0. +- Fix Uniscribe backend font-size scaling. +- Declare dependencies in harfbuzz.pc. + FreeType is not declared though, to avoid bugs in pkg-config + 0.26 with recursive dependencies. +- Slightly improved debug infrastructure. More to come later. +- Misc build fixes. + + Overview of changes leading to 1.0.1 Monday, July 27, 2015 ==================================== diff --git a/third_party/harfbuzz-ng/README.chromium b/third_party/harfbuzz-ng/README.chromium index afad251d9..2a66866 100644 --- a/third_party/harfbuzz-ng/README.chromium +++ b/third_party/harfbuzz-ng/README.chromium @@ -1,8 +1,8 @@ Name: harfbuzz-ng Short Name: harfbuzz-ng URL: http://harfbuzz.org -Version: 1.0.1 -Date: 20150627 +Version: 1.0.2 +Date: 20150820 Security Critical: yes License: MIT License File: COPYING diff --git a/third_party/harfbuzz-ng/src/hb-buffer-serialize.cc b/third_party/harfbuzz-ng/src/hb-buffer-serialize.cc index 406d69d..8a22224 100644 --- a/third_party/harfbuzz-ng/src/hb-buffer-serialize.cc +++ b/third_party/harfbuzz-ng/src/hb-buffer-serialize.cc @@ -99,7 +99,8 @@ _hb_buffer_serialize_glyphs_json (hb_buffer_t *buffer, hb_buffer_serialize_flags_t flags) { hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, NULL); - hb_glyph_position_t *pos = hb_buffer_get_glyph_positions (buffer, NULL); + hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ? + NULL : hb_buffer_get_glyph_positions (buffer, NULL); *buf_consumed = 0; for (unsigned int i = start; i < end; i++) @@ -172,7 +173,8 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer, hb_buffer_serialize_flags_t flags) { hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, NULL); - hb_glyph_position_t *pos = hb_buffer_get_glyph_positions (buffer, NULL); + hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ? + NULL : hb_buffer_get_glyph_positions (buffer, NULL); *buf_consumed = 0; for (unsigned int i = start; i < end; i++) diff --git a/third_party/harfbuzz-ng/src/hb-coretext.cc b/third_party/harfbuzz-ng/src/hb-coretext.cc index 0b710c2..a9664ee 100644 --- a/third_party/harfbuzz-ng/src/hb-coretext.cc +++ b/third_party/harfbuzz-ng/src/hb-coretext.cc @@ -156,6 +156,7 @@ _hb_coretext_shaper_font_data_create (hb_font_t *font) hb_coretext_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face); /* Choose a CoreText font size and calculate multipliers to convert to HarfBuzz space. */ + /* TODO: use upem instead of 36? */ CGFloat font_size = 36.; /* Default... */ /* No idea if the following is even a good idea. */ if (font->y_ppem) @@ -915,8 +916,8 @@ retry: info->cluster = log_clusters[j]; info->mask = advance; - info->var1.u32 = x_offset; - info->var2.u32 = y_offset; + info->var1.i32 = x_offset; + info->var2.i32 = y_offset; info++; buffer->len++; @@ -1002,8 +1003,8 @@ retry: else /* last glyph */ advance = run_advance - (positions[j].x - positions[0].x); info->mask = advance * x_mult; - info->var1.u32 = x_offset; - info->var2.u32 = positions[j].y * y_mult; + info->var1.i32 = x_offset; + info->var2.i32 = positions[j].y * y_mult; info++; } } @@ -1018,8 +1019,8 @@ retry: else /* last glyph */ advance = run_advance - (positions[j].y - positions[0].y); info->mask = advance * y_mult; - info->var1.u32 = positions[j].x * x_mult; - info->var2.u32 = y_offset; + info->var1.i32 = positions[j].x * x_mult; + info->var2.i32 = y_offset; info++; } } @@ -1034,10 +1035,20 @@ retry: buffer->len += num_glyphs; } - /* Make sure all runs had the expected direction. */ - bool backward = HB_DIRECTION_IS_BACKWARD (buffer->props.direction); - assert (bool (status_and & kCTRunStatusRightToLeft) == backward); - assert (bool (status_or & kCTRunStatusRightToLeft) == backward); + /* Mac OS 10.6 doesn't have kCTTypesetterOptionForcedEmbeddingLevel, + * or if it does, it doesn't resepct it. So we get runs with wrong + * directions. As such, disable the assert... It wouldn't crash, but + * cursoring will be off... + * + * http://crbug.com/419769 + */ + if (0) + { + /* Make sure all runs had the expected direction. */ + bool backward = HB_DIRECTION_IS_BACKWARD (buffer->props.direction); + assert (bool (status_and & kCTRunStatusRightToLeft) == backward); + assert (bool (status_or & kCTRunStatusRightToLeft) == backward); + } buffer->clear_positions (); @@ -1048,16 +1059,16 @@ retry: for (unsigned int i = 0; i < count; i++) { pos->x_advance = info->mask; - pos->x_offset = info->var1.u32; - pos->y_offset = info->var2.u32; + pos->x_offset = info->var1.i32; + pos->y_offset = info->var2.i32; info++, pos++; } else for (unsigned int i = 0; i < count; i++) { pos->y_advance = info->mask; - pos->x_offset = info->var1.u32; - pos->y_offset = info->var2.u32; + pos->x_offset = info->var1.i32; + pos->y_offset = info->var2.i32; info++, pos++; } diff --git a/third_party/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh b/third_party/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh index 69609d0..da9506c 100644 --- a/third_party/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh +++ b/third_party/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh @@ -1568,8 +1568,11 @@ template <typename context_t> const GPOS &gpos = *(hb_ot_layout_from_face (c->face)->gpos); const PosLookup &l = gpos.get_lookup (lookup_index); unsigned int saved_lookup_props = c->lookup_props; - c->set_lookup (l); + unsigned int saved_lookup_index = c->lookup_index; + c->set_lookup_index (lookup_index); + c->set_lookup_props (l.get_props ()); bool ret = l.dispatch (c); + c->set_lookup_index (saved_lookup_index); c->set_lookup_props (saved_lookup_props); return ret; } diff --git a/third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh b/third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh index ad1339d..ff20484 100644 --- a/third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh +++ b/third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh @@ -1311,8 +1311,11 @@ template <typename context_t> const GSUB &gsub = *(hb_ot_layout_from_face (c->face)->gsub); const SubstLookup &l = gsub.get_lookup (lookup_index); unsigned int saved_lookup_props = c->lookup_props; - c->set_lookup (l); + unsigned int saved_lookup_index = c->lookup_index; + c->set_lookup_index (lookup_index); + c->set_lookup_props (l.get_props ()); bool ret = l.dispatch (c); + c->set_lookup_index (saved_lookup_index); c->set_lookup_props (saved_lookup_props); return ret; } diff --git a/third_party/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh b/third_party/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh index 5033a22..3e74dfe 100644 --- a/third_party/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh +++ b/third_party/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh @@ -266,7 +266,8 @@ struct hb_add_coverage_context_t #define TRACE_APPLY(this) \ hb_auto_trace_t<HB_DEBUG_APPLY, bool> trace \ (&c->debug_depth, c->get_name (), this, HB_FUNC, \ - "idx %d codepoint %u", c->buffer->idx, c->buffer->cur().codepoint); + "idx %d gid %u lookup %d", \ + c->buffer->idx, c->buffer->cur().codepoint, (int) c->lookup_index); struct hb_apply_context_t { @@ -481,6 +482,7 @@ struct hb_apply_context_t const GDEF &gdef; bool has_glyph_classes; skipping_iterator_t iter_input, iter_context; + unsigned int lookup_index; unsigned int debug_depth; @@ -499,12 +501,13 @@ struct hb_apply_context_t has_glyph_classes (gdef.has_glyph_classes ()), iter_input (), iter_context (), + lookup_index ((unsigned int) -1), debug_depth (0) {} inline void set_lookup_mask (hb_mask_t mask) { lookup_mask = mask; } inline void set_auto_zwj (bool auto_zwj_) { auto_zwj = auto_zwj_; } inline void set_recurse_func (recurse_func_t func) { recurse_func = func; } - inline void set_lookup (const Lookup &l) { set_lookup_props (l.get_props ()); } + inline void set_lookup_index (unsigned int lookup_index_) { lookup_index = lookup_index_; } inline void set_lookup_props (unsigned int lookup_props_) { lookup_props = lookup_props_; diff --git a/third_party/harfbuzz-ng/src/hb-ot-layout.cc b/third_party/harfbuzz-ng/src/hb-ot-layout.cc index 6fe7b6c..39d007d 100644 --- a/third_party/harfbuzz-ng/src/hb-ot-layout.cc +++ b/third_party/harfbuzz-ng/src/hb-ot-layout.cc @@ -959,7 +959,7 @@ apply_string (OT::hb_apply_context_t *c, if (unlikely (!buffer->len || !c->lookup_mask)) return; - c->set_lookup (lookup); + c->set_lookup_props (lookup.get_props ()); if (likely (!lookup.is_reverse ())) { @@ -1010,7 +1010,20 @@ inline void hb_ot_map_t::apply (const Proxy &proxy, const stage_map_t *stage = &stages[table_index][stage_index]; for (; i < stage->last_lookup; i++) { +#if 0 + char buf[4096]; + hb_buffer_serialize_glyphs (buffer, 0, buffer->len, + buf, sizeof (buf), NULL, + font, + HB_BUFFER_SERIALIZE_FORMAT_TEXT, + Proxy::table_index == 0 ? + HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS : + HB_BUFFER_SERIALIZE_FLAG_DEFAULT); + printf ("buf: [%s]\n", buf); +#endif + unsigned int lookup_index = lookups[table_index][i].index; + c.set_lookup_index (lookup_index); c.set_lookup_mask (lookups[table_index][i].mask); c.set_auto_zwj (lookups[table_index][i].auto_zwj); apply_string<Proxy> (&c, diff --git a/third_party/harfbuzz-ng/src/hb-ot-shape-fallback.cc b/third_party/harfbuzz-ng/src/hb-ot-shape-fallback.cc index 53274b5..748372d 100644 --- a/third_party/harfbuzz-ng/src/hb-ot-shape-fallback.cc +++ b/third_party/harfbuzz-ng/src/hb-ot-shape-fallback.cc @@ -418,13 +418,12 @@ _hb_ot_shape_fallback_position (const hb_ot_shape_plan_t *plan, _hb_buffer_assert_gsubgpos_vars (buffer); unsigned int start = 0; - unsigned int last_cluster = buffer->info[0].cluster; unsigned int count = buffer->len; + hb_glyph_info_t *info = buffer->info; for (unsigned int i = 1; i < count; i++) - if (buffer->info[i].cluster != last_cluster) { + if (likely (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[i])))) { position_cluster (plan, font, buffer, start, i); start = i; - last_cluster = buffer->info[i].cluster; } position_cluster (plan, font, buffer, start, count); } diff --git a/third_party/harfbuzz-ng/src/hb-ot-shape-normalize.cc b/third_party/harfbuzz-ng/src/hb-ot-shape-normalize.cc index 8cc64af..111b590 100644 --- a/third_party/harfbuzz-ng/src/hb-ot-shape-normalize.cc +++ b/third_party/harfbuzz-ng/src/hb-ot-shape-normalize.cc @@ -323,7 +323,7 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan, { unsigned int end; for (end = buffer->idx + 1; end < count; end++) - if (buffer->cur().cluster != buffer->info[end].cluster) + if (likely (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->info[end])))) break; decompose_cluster (&c, end, might_short_circuit, always_short_circuit); diff --git a/third_party/harfbuzz-ng/src/hb-ot-shape.cc b/third_party/harfbuzz-ng/src/hb-ot-shape.cc index f20be2a..e24f7a8 100644 --- a/third_party/harfbuzz-ng/src/hb-ot-shape.cc +++ b/third_party/harfbuzz-ng/src/hb-ot-shape.cc @@ -513,6 +513,8 @@ hb_ot_map_glyphs_fast (hb_buffer_t *buffer) hb_glyph_info_t *info = buffer->info; for (unsigned int i = 0; i < count; i++) info[i].codepoint = info[i].glyph_index(); + + buffer->content_type = HB_BUFFER_CONTENT_TYPE_GLYPHS; } static inline void diff --git a/third_party/harfbuzz-ng/src/hb-version.h b/third_party/harfbuzz-ng/src/hb-version.h index aea115f..f46d204 100644 --- a/third_party/harfbuzz-ng/src/hb-version.h +++ b/third_party/harfbuzz-ng/src/hb-version.h @@ -38,9 +38,9 @@ HB_BEGIN_DECLS #define HB_VERSION_MAJOR 1 #define HB_VERSION_MINOR 0 -#define HB_VERSION_MICRO 1 +#define HB_VERSION_MICRO 2 -#define HB_VERSION_STRING "1.0.1" +#define HB_VERSION_STRING "1.0.2" #define HB_VERSION_ATLEAST(major,minor,micro) \ ((major)*10000+(minor)*100+(micro) <= \ |