diff -r 9289c4214a35 -r 25db2c8f3cf8 src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape.cc --- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape.cc Wed May 30 08:10:41 2018 -0700 +++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape.cc Wed May 30 12:20:00 2018 -0700 @@ -40,6 +40,8 @@ #include "hb-unicode-private.hh" #include "hb-set-private.hh" +#include "hb-ot-layout-gsubgpos-private.hh" +//#include "hb-aat-layout-private.hh" static hb_tag_t common_features[] = { HB_TAG('c','c','m','p'), @@ -108,7 +110,7 @@ /* We really want to find a 'vert' feature if there's any in the font, no * matter which script/langsys it is listed (or not) under. * See various bugs referenced from: - * https://github.com/behdad/harfbuzz/issues/63 */ + * https://github.com/harfbuzz/harfbuzz/issues/63 */ map->add_feature (HB_TAG ('v','e','r','t'), 1, F_GLOBAL | F_GLOBAL_SEARCH); } @@ -450,7 +452,8 @@ hb_buffer_t *buffer = c->buffer; if (!(buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_DEFAULT_IGNORABLES) || - (buffer->flags & HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES)) + (buffer->flags & HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES) || + (buffer->flags & HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES)) return; unsigned int count = buffer->len; @@ -486,7 +489,8 @@ return; hb_codepoint_t space; - if (c->font->get_nominal_glyph (' ', &space)) + if (!(buffer->flags & HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES) && + c->font->get_nominal_glyph (' ', &space)) { /* Replace default-ignorables with a zero-advance space glyph. */ for (/*continue*/; i < count; i++) @@ -614,7 +618,8 @@ c->plan->substitute (c->font, buffer); - return; + /* XXX Call morx instead. */ + //hb_aat_layout_substitute (c->font, c->buffer); } static inline void @@ -782,6 +787,8 @@ _hb_ot_shape_fallback_kern (c->plan, c->font, c->buffer); _hb_buffer_deallocate_gsubgpos_vars (c->buffer); + + //hb_aat_layout_position (c->font, c->buffer); } static inline void @@ -817,11 +824,16 @@ { c->buffer->deallocate_var_all (); c->buffer->scratch_flags = HB_BUFFER_SCRATCH_FLAG_DEFAULT; - if (likely (!_hb_unsigned_int_mul_overflows (c->buffer->len, HB_BUFFER_MAX_EXPANSION_FACTOR))) + if (likely (!_hb_unsigned_int_mul_overflows (c->buffer->len, HB_BUFFER_MAX_LEN_FACTOR))) { - c->buffer->max_len = MAX (c->buffer->len * HB_BUFFER_MAX_EXPANSION_FACTOR, + c->buffer->max_len = MAX (c->buffer->len * HB_BUFFER_MAX_LEN_FACTOR, (unsigned) HB_BUFFER_MAX_LEN_MIN); } + if (likely (!_hb_unsigned_int_mul_overflows (c->buffer->len, HB_BUFFER_MAX_OPS_FACTOR))) + { + c->buffer->max_ops = MAX (c->buffer->len * HB_BUFFER_MAX_OPS_FACTOR, + (unsigned) HB_BUFFER_MAX_OPS_MIN); + } bool disable_otl = c->plan->shaper->disable_otl && c->plan->shaper->disable_otl (c->plan); //c->fallback_substitute = disable_otl || !hb_ot_layout_has_substitution (c->face); @@ -861,6 +873,7 @@ c->buffer->props.direction = c->target_direction; c->buffer->max_len = HB_BUFFER_MAX_LEN_DEFAULT; + c->buffer->max_ops = HB_BUFFER_MAX_OPS_DEFAULT; c->buffer->deallocate_var_all (); } @@ -946,7 +959,7 @@ hb_set_t *copy = hb_set_create (); do { copy->set (glyphs); - for (hb_codepoint_t lookup_index = -1; hb_set_next (lookups, &lookup_index);) + for (hb_codepoint_t lookup_index = HB_SET_VALUE_INVALID; hb_set_next (lookups, &lookup_index);) hb_ot_layout_lookup_substitute_closure (font->face, lookup_index, glyphs); } while (!copy->is_equal (glyphs)); hb_set_destroy (copy);