From 009aad567863c05ee2ec4a3ee76fe0ee79c767bb Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 20 May 2010 14:00:57 +0100 Subject: [PATCH] Invert the mask logic Before, the mask in the buffer was inverted. That is, a 0 bit meant feature should be applied and 1 meant not applied, whereas in the lookups, the logic was positive. Now both are in sync. When calling hb_buffer_add_glyph() manually, the mask should be 1 instead of 0. --- src/hb-buffer.cc | 2 +- src/hb-ot-layout-gpos-private.hh | 2 +- src/hb-ot-layout-gsub-private.hh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index a384d1f18..0b77919be 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -551,7 +551,7 @@ hb_buffer_reverse_clusters (hb_buffer_t *buffer) hb_codepoint_t u; \ const T *old_next = next; \ next = UTF_NEXT (next, end, u); \ - hb_buffer_add_glyph (buffer, u, 0, old_next - (const T *) text); \ + hb_buffer_add_glyph (buffer, u, 1, old_next - (const T *) text); \ } \ } HB_STMT_END diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh index 81e18d485..cb66aec74 100644 --- a/src/hb-ot-layout-gpos-private.hh +++ b/src/hb-ot-layout-gpos-private.hh @@ -1535,7 +1535,7 @@ struct PosLookup : Lookup while (buffer->i < buffer->len) { bool done; - if (~buffer->info[buffer->i].mask & mask) + if (buffer->info[buffer->i].mask & mask) { done = apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL); ret |= done; diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh index 828c45825..96c1c9caa 100644 --- a/src/hb-ot-layout-gsub-private.hh +++ b/src/hb-ot-layout-gsub-private.hh @@ -830,7 +830,7 @@ struct SubstLookup : Lookup buffer->i = 0; while (buffer->i < buffer->len) { - if ((~buffer->info[buffer->i].mask & mask) && + if ((buffer->info[buffer->i].mask & mask) && apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL)) ret = true; else @@ -846,7 +846,7 @@ struct SubstLookup : Lookup buffer->i = buffer->len - 1; do { - if ((~buffer->info[buffer->i].mask & mask) && + if ((buffer->info[buffer->i].mask & mask) && apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL)) ret = true; else