[ChainContext] Fix fast-path deviation from slow path

See comments. The input skippy was hitting the U+200D and NOT
seeing it skippable, whereas the context skippy would had.

Fixes https://github.com/harfbuzz/harfbuzz/issues/4813
pull/4814/head
Behdad Esfahbod 7 months ago
parent fe7dc0c3cf
commit 788b469ad5
  1. 13
      src/hb-ot-layout-gsubgpos.hh
  2. BIN
      test/shape/data/in-house/fonts/63e224dcb3d559d590f80c83b832cfca789e5dcc.ttf
  3. 1
      test/shape/data/in-house/tests/indic-joiners.tests

@ -3390,6 +3390,15 @@ struct ChainRuleSet
*
* Replicated from LigatureSet::apply(). */
/* If the input skippy has non-auto joiners behavior (as in Indic shapers),
* skip this fast path, as we don't distinguish between input & lookahead
* matching in the fast path.
*
* https://github.com/harfbuzz/harfbuzz/issues/4813
*/
if (!c->auto_zwnj || !c->auto_zwj)
goto slow;
hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
skippy_iter.reset (c->buffer->idx);
skippy_iter.set_match_func (match_always, nullptr);
@ -3429,10 +3438,10 @@ struct ChainRuleSet
}
matched = skippy_iter.next ();
if (likely (matched && !skippy_iter.may_skip (c->buffer->info[skippy_iter.idx])))
{
{
second = &c->buffer->info[skippy_iter.idx];
unsafe_to2 = skippy_iter.idx + 1;
}
}
auto match_input = lookup_context.funcs.match[1];
auto match_lookahead = lookup_context.funcs.match[2];

@ -4,3 +4,4 @@
../fonts/8116e5d8fedfbec74e45dc350d2416d810bed8c4.ttf;;U+091F,U+094D,U+200D,U+092F,U+093F;[uni093F=0+398|uni091F=0+876|uni094D=0@4,0+0|space=0+0|uni092F=0+924]
../fonts/8116e5d8fedfbec74e45dc350d2416d810bed8c4.ttf;;U+091F,U+094D,U+200D,U+091F,U+094D,U+200C,U+091F,U+094D,U+200D,U+092F,U+093F;[uni091F=0+876|uni094D=0@4,0+0|space=0+0|uni091F=3+876|uni094D=3@4,0+0|space=5+0|uni093F=6+398|uni091F=6+876|uni094D=6@4,0+0|space=6+0|uni092F=6+924]
../fonts/8116e5d8fedfbec74e45dc350d2416d810bed8c4.ttf;;U+091F,U+094D,U+200D,U+091F,U+094D,U+200D,U+091F,U+094D,U+200D,U+092F,U+093F;[uni093F=0+398|uni091F=0+876|uni094D=0@4,0+0|space=0+0|uni091F=0+876|uni094D=0@4,0+0|space=0+0|uni091F=0+876|uni094D=0@4,0+0|space=0+0|uni092F=0+924]
../fonts/63e224dcb3d559d590f80c83b832cfca789e5dcc.ttf;;U+0ABE,U+0AA8,U+0ACD,U+200D,U+0AA4,U+0ABF;[uni25CC=0+596|uni0ABE=0+251|uni0ABF.05=1+251|uni0AA80ACD=1+293|space=1+0|uni0AA4=1+543]

Loading…
Cancel
Save