diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index a45062aa5..6b05d3a6a 100644 --- a/src/hb-buffer.cc +++ b/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 **/ @@ -1898,6 +1897,7 @@ hb_buffer_diff (hb_buffer_t *buffer, 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/test/shaping/run-tests.sh b/test/shaping/run-tests.sh index 9c4963148..2b10e7c83 100755 --- a/test/shaping/run-tests.sh +++ b/test/shaping/run-tests.sh @@ -4,8 +4,8 @@ test "x$srcdir" = x && srcdir=. test "x$builddir" = x && builddir=. test "x$top_builddir" = x && top_builddir=../.. -#hb_shape="$top_builddir/util/hb-shape$EXEEXT --verify" -hb_shape="$top_builddir/util/hb-shape$EXEEXT" +hb_shape="$top_builddir/util/hb-shape$EXEEXT --verify" +#hb_shape="$top_builddir/util/hb-shape$EXEEXT" fails=0 diff --git a/util/options.hh b/util/options.hh index dbc4eaf94..9ad2225d5 100644 --- a/util/options.hh +++ b/util/options.hh @@ -409,7 +409,7 @@ struct shape_options_t : option_group_t } bool ret = true; - hb_buffer_diff_flags_t diff = hb_buffer_diff (buffer, reconstruction, 0, 0); + hb_buffer_diff_flags_t diff = hb_buffer_diff (buffer, reconstruction, (hb_codepoint_t) -1, 0); if (diff) { if (error)