diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src')
4 files changed, 25 insertions, 18 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc index a45062aa5ae..171d1016e3f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc @@ -31,10 +31,6 @@ #include "hb-utf-private.hh" -#ifndef HB_DEBUG_BUFFER -#define HB_DEBUG_BUFFER (HB_DEBUG+0) -#endif - /** * SECTION: hb-buffer * @title: Buffers @@ -1885,6 +1881,9 @@ hb_buffer_t::sort (unsigned int start, unsigned int end, int(*compar)(const hb_g /** * hb_buffer_diff: * + * If dottedcircle_glyph is (hb_codepoint_t) -1 then %HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT + * and %HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT are never returned. This should be used by most + * callers if just comparing two buffers is needed. * * Since: 1.5.0 **/ @@ -1894,10 +1893,11 @@ hb_buffer_diff (hb_buffer_t *buffer, hb_codepoint_t dottedcircle_glyph, unsigned int position_fuzz) { - if (buffer->content_type != reference->content_type) + if (buffer->content_type != reference->content_type && buffer->len && reference->len) return HB_BUFFER_DIFF_FLAG_CONTENT_TYPE_MISMATCH; hb_buffer_diff_flags_t result = HB_BUFFER_DIFF_FLAG_EQUAL; + bool contains = dottedcircle_glyph != (hb_codepoint_t) -1; unsigned int count = reference->len; @@ -1911,9 +1911,9 @@ hb_buffer_diff (hb_buffer_t *buffer, unsigned int i; for (i = 0; i < count; i++) { - if (info[i].codepoint == dottedcircle_glyph) + if (contains && info[i].codepoint == dottedcircle_glyph) result |= HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT; - else if (info[i].codepoint == 0) + if (contains && info[i].codepoint == 0) result |= HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT; } result |= HB_BUFFER_DIFF_FLAG_LENGTH_MISMATCH; @@ -1933,9 +1933,9 @@ hb_buffer_diff (hb_buffer_t *buffer, result |= HB_BUFFER_DIFF_FLAG_CLUSTER_MISMATCH; if ((buf_info->mask & HB_GLYPH_FLAG_DEFINED) != (ref_info->mask & HB_GLYPH_FLAG_DEFINED)) result |= HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH; - if (ref_info->codepoint == dottedcircle_glyph) + if (contains && ref_info->codepoint == dottedcircle_glyph) result |= HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT; - else if (ref_info->codepoint == 0) + if (contains && ref_info->codepoint == 0) result |= HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT; buf_info++; ref_info++; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.h index ffbf66ee12f..1d633f7dcdd 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.h +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.h @@ -481,12 +481,12 @@ typedef enum { /*< flags >*/ /* Buffers with different content_type cannot be meaningfully compared * in any further detail. */ - HB_BUFFER_DIFF_FLAG_CONTENT_TYPE_MISMATCH = 0X0001, + HB_BUFFER_DIFF_FLAG_CONTENT_TYPE_MISMATCH = 0x0001, /* For buffers with differing length, the per-glyph comparison is not * attempted, though we do still scan reference for dottedcircle / .notdef * glyphs. */ - HB_BUFFER_DIFF_FLAG_LENGTH_MISMATCH = 0X0002, + HB_BUFFER_DIFF_FLAG_LENGTH_MISMATCH = 0x0002, /* We want to know if dottedcircle / .notdef glyphs are present in the * reference, as we may not care so much about other differences in this diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic-private.hh index 58be4222465..c880311ee4c 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic-private.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic-private.hh @@ -121,7 +121,7 @@ enum indic_syllabic_category_t { INDIC_SYLLABIC_CATEGORY_CONSONANT_PREFIXED = OT_X, /* Don't care. */ INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED = OT_CM, INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA = OT_N, - INDIC_SYLLABIC_CATEGORY_CONSONANT_WITH_STACKER = OT_Repha, /* TODO */ + INDIC_SYLLABIC_CATEGORY_CONSONANT_WITH_STACKER = OT_C, INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK = OT_SM, INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER = OT_Coeng, INDIC_SYLLABIC_CATEGORY_JOINER = OT_ZWJ, diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc index bc5366969be..8cd8fcc17e0 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc @@ -275,8 +275,7 @@ hb_insert_dotted_circle (hb_buffer_t *buffer, hb_font_t *font) static void hb_form_clusters (hb_buffer_t *buffer) { - if (!(buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII) || - buffer->cluster_level != HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES) + if (!(buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII)) return; /* Loop duplicated in hb_ensure_native_direction(), and in _hb-coretext.cc */ @@ -288,11 +287,17 @@ hb_form_clusters (hb_buffer_t *buffer) if (likely (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[i])) && !_hb_glyph_info_is_joiner (&info[i]))) { - buffer->merge_clusters (base, i); + if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES) + buffer->merge_clusters (base, i); + else + buffer->unsafe_to_break (base, i); base = i; } } - buffer->merge_clusters (base, count); + if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES) + buffer->merge_clusters (base, count); + else + buffer->unsafe_to_break (base, count); } static void @@ -394,6 +399,8 @@ hb_ot_shape_setup_masks_fraction (hb_ot_shape_context_t *c) HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER) end++; + buffer->unsafe_to_break (start, end); + for (unsigned int j = start; j < i; j++) info[j].mask |= pre_mask; info[i].mask |= c->plan->frac_mask; @@ -578,8 +585,6 @@ hb_ot_substitute_default (hb_ot_shape_context_t *c) { hb_buffer_t *buffer = c->buffer; - hb_ot_shape_initialize_masks (c); - hb_ot_mirror_chars (c); HB_BUFFER_ALLOCATE_VAR (buffer, glyph_index); @@ -834,8 +839,10 @@ hb_ot_shape_internal (hb_ot_shape_context_t *c) c->buffer->clear_output (); + hb_ot_shape_initialize_masks (c); hb_set_unicode_props (c->buffer); hb_insert_dotted_circle (c->buffer, c->font); + hb_form_clusters (c->buffer); hb_ensure_native_direction (c->buffer); |