diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2014-07-18 03:13:19 +0300 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2014-07-20 01:12:24 +0200 |
commit | 461c2b20044359b80df8217a7565c7b8a60a1f0b (patch) | |
tree | a95666c97d87f0a9f3c02bee1fd08bcf47bcc748 /src/3rdparty/harfbuzz-ng/src/hb-ot-shape-fallback.cc | |
parent | 0078013693c96ad2d0fe7d50d4eb733df2c041ab (diff) |
Update bundled HarfBuzz-NG copy to 0.9.32
- Unicode 7.0 support
- New shapers
- Multiple improvements in Arabic, Indic, and Hebrew shapers
- Build fixes, optimizations, etc.
Change-Id: I0ba14b619c3e6fb35cddd9d65e694af41197d6ae
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-ot-shape-fallback.cc')
-rw-r--r-- | src/3rdparty/harfbuzz-ng/src/hb-ot-shape-fallback.cc | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-fallback.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-fallback.cc index 5d526c3a8e..a774f95185 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-fallback.cc +++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-fallback.cc @@ -35,42 +35,42 @@ recategorize_combining_class (hb_codepoint_t u, return klass; /* Thai / Lao need some per-character work. */ - if ((u & ~0xFF) == 0x0E00) + if ((u & ~0xFF) == 0x0E00u) { if (unlikely (klass == 0)) { switch (u) { - case 0x0E31: - case 0x0E34: - case 0x0E35: - case 0x0E36: - case 0x0E37: - case 0x0E47: - case 0x0E4C: - case 0x0E4D: - case 0x0E4E: + case 0x0E31u: + case 0x0E34u: + case 0x0E35u: + case 0x0E36u: + case 0x0E37u: + case 0x0E47u: + case 0x0E4Cu: + case 0x0E4Du: + case 0x0E4Eu: klass = HB_UNICODE_COMBINING_CLASS_ABOVE_RIGHT; break; - case 0x0EB1: - case 0x0EB4: - case 0x0EB5: - case 0x0EB6: - case 0x0EB7: - case 0x0EBB: - case 0x0ECC: - case 0x0ECD: + case 0x0EB1u: + case 0x0EB4u: + case 0x0EB5u: + case 0x0EB6u: + case 0x0EB7u: + case 0x0EBBu: + case 0x0ECCu: + case 0x0ECDu: klass = HB_UNICODE_COMBINING_CLASS_ABOVE; break; - case 0x0EBC: + case 0x0EBCu: klass = HB_UNICODE_COMBINING_CLASS_BELOW; break; } } else { /* Thai virama is below-right */ - if (u == 0x0E3A) + if (u == 0x0E3Au) klass = HB_UNICODE_COMBINING_CLASS_BELOW_RIGHT; } } @@ -167,11 +167,12 @@ _hb_ot_shape_fallback_position_recategorize_marks (const hb_ot_shape_plan_t *pla hb_buffer_t *buffer) { unsigned int count = buffer->len; + hb_glyph_info_t *info = buffer->info; for (unsigned int i = 0; i < count; i++) - if (_hb_glyph_info_get_general_category (&buffer->info[i]) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) { - unsigned int combining_class = _hb_glyph_info_get_modified_combining_class (&buffer->info[i]); - combining_class = recategorize_combining_class (buffer->info[i].codepoint, combining_class); - _hb_glyph_info_set_modified_combining_class (&buffer->info[i], combining_class); + if (_hb_glyph_info_get_general_category (&info[i]) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) { + unsigned int combining_class = _hb_glyph_info_get_modified_combining_class (&info[i]); + combining_class = recategorize_combining_class (info[i].codepoint, combining_class); + _hb_glyph_info_set_modified_combining_class (&info[i], combining_class); } } @@ -181,8 +182,9 @@ zero_mark_advances (hb_buffer_t *buffer, unsigned int start, unsigned int end) { + hb_glyph_info_t *info = buffer->info; for (unsigned int i = start; i < end; i++) - if (_hb_glyph_info_get_general_category (&buffer->info[i]) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) + if (_hb_glyph_info_get_general_category (&info[i]) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) { buffer->pos[i].x_advance = 0; buffer->pos[i].y_advance = 0; @@ -327,12 +329,13 @@ position_around_base (const hb_ot_shape_plan_t *plan, unsigned int last_lig_component = (unsigned int) -1; unsigned int last_combining_class = 255; hb_glyph_extents_t cluster_extents = base_extents; /* Initialization is just to shut gcc up. */ + hb_glyph_info_t *info = buffer->info; for (unsigned int i = base + 1; i < end; i++) - if (_hb_glyph_info_get_modified_combining_class (&buffer->info[i])) + if (_hb_glyph_info_get_modified_combining_class (&info[i])) { if (num_lig_components > 1) { - unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&buffer->info[i]); - unsigned int this_lig_component = _hb_glyph_info_get_lig_comp (&buffer->info[i]) - 1; + unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&info[i]); + unsigned int this_lig_component = _hb_glyph_info_get_lig_comp (&info[i]) - 1; /* Conditions for attaching to the last component. */ if (!lig_id || lig_id != this_lig_id || this_lig_component >= num_lig_components) this_lig_component = num_lig_components - 1; @@ -355,7 +358,7 @@ position_around_base (const hb_ot_shape_plan_t *plan, } } - unsigned int this_combining_class = _hb_glyph_info_get_modified_combining_class (&buffer->info[i]); + unsigned int this_combining_class = _hb_glyph_info_get_modified_combining_class (&info[i]); if (last_combining_class != this_combining_class) { last_combining_class = this_combining_class; @@ -391,13 +394,14 @@ position_cluster (const hb_ot_shape_plan_t *plan, return; /* Find the base glyph */ + hb_glyph_info_t *info = buffer->info; for (unsigned int i = start; i < end; i++) - if (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->info[i]))) + if (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[i]))) { /* Find mark glyphs */ unsigned int j; for (j = i + 1; j < end; j++) - if (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->info[j]))) + if (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[j]))) break; position_around_base (plan, font, buffer, i, j); @@ -432,15 +436,13 @@ _hb_ot_shape_fallback_kern (const hb_ot_shape_plan_t *plan, { if (!plan->has_kern) return; - unsigned int count = buffer->len; - OT::hb_apply_context_t c (1, font, buffer); c.set_lookup_mask (plan->kern_mask); c.set_lookup_props (OT::LookupFlag::IgnoreMarks); + unsigned int count = buffer->len; hb_glyph_info_t *info = buffer->info; hb_glyph_position_t *pos = buffer->pos; - for (unsigned int idx = 0; idx < count;) { OT::hb_apply_context_t::skipping_forward_iterator_t skippy_iter (&c, idx, 1); |