[morx] Reword ligation

Still fails MORX-41.  Am talking to Sascha to better understand what CoreText
is doing.
This commit is contained in:
Behdad Esfahbod 2018-10-16 14:46:07 -07:00
parent c53a25c657
commit 2137582c96
3 changed files with 17 additions and 12 deletions

View File

@ -393,16 +393,18 @@ struct LigatureSubtable
unsigned int ligature_idx = 0;
if (unlikely (!match_length))
return false;
return true;
/* TODO Only when ligation happens? */
buffer->merge_out_clusters (match_positions[0], buffer->out_len);
unsigned int cursor = match_length;
do
{
if (unlikely (!match_length))
return false;
if (unlikely (!cursor))
break;
buffer->move_to (match_positions[--match_length]);
buffer->move_to (match_positions[--cursor]);
const HBUINT32 &actionData = ligAction[action_idx];
if (unlikely (!actionData.sanitize (&c->sanitizer))) return false;
@ -426,20 +428,21 @@ struct LigatureSubtable
if (unlikely (!ligatureData.sanitize (&c->sanitizer))) return false;
hb_codepoint_t lig = ligatureData;
match_positions[match_length++] = buffer->out_len;
buffer->replace_glyph (lig);
//ligature_idx = 0; // XXX Yes or no?
}
else
{
buffer->skip_glyph ();
end--;
/* Now go and delete all subsequent components. */
while (match_length - 1 > cursor)
{
buffer->move_to (match_positions[--match_length]);
buffer->skip_glyph ();
end--;
}
}
action_idx++;
}
while (!(action & LigActionLast));
match_length = 0;
buffer->move_to (end);
}

View File

@ -1,3 +1,5 @@
tests/MORX-41.tests
# Non-Unicode cmap
tests/CMAP-3.tests

View File

@ -62,7 +62,6 @@ TESTS = \
tests/MORX-39.tests \
tests/MORX-3.tests \
tests/MORX-40.tests \
tests/MORX-41.tests \
tests/MORX-4.tests \
tests/MORX-5.tests \
tests/MORX-6.tests \
@ -74,6 +73,7 @@ TESTS = \
$(NULL)
DISBALED_TESTS = \
tests/MORX-41.tests \
tests/CMAP-3.tests \
tests/SHARAN-1.tests \
tests/SHBALI-1.tests \