In MarkBase attachment, only attach to first of a MultipleSubst sequence

This is apparently what Uniscribe does.  Test case is:

  SEEN FATHA TEH ALEF

with Arabic Typesetting.  Originally reported by Khaled Hosny.
This commit is contained in:
Behdad Esfahbod 2012-06-08 22:04:23 -04:00
parent ec57e0c565
commit 7b84c536c1
2 changed files with 14 additions and 1 deletions

View File

@ -955,7 +955,12 @@ struct MarkBasePosFormat1
/* now we search backwards for a non-mark glyph */
unsigned int property;
hb_apply_context_t::mark_skipping_backward_iterator_t skippy_iter (c, c->buffer->idx, 1);
if (!skippy_iter.prev (&property, LookupFlag::IgnoreMarks)) return TRACE_RETURN (false);
do {
if (!skippy_iter.prev (&property, LookupFlag::IgnoreMarks)) return TRACE_RETURN (false);
/* We only want to attach to the first of a MultipleSubst sequence. Reject others. */
if (0 == get_lig_comp (c->buffer->info[skippy_iter.idx])) break;
skippy_iter.reject ();
} while (1);
/* The following assertion is too strong, so we've disabled it. */
if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH)) {/*return TRACE_RETURN (false);*/}

View File

@ -144,6 +144,10 @@ struct hb_apply_context_t
{
return unlikely (num_items && idx + num_items >= end);
}
inline bool reject (void)
{
num_items++;
}
inline bool next (unsigned int *property_out,
unsigned int lookup_props)
{
@ -189,6 +193,10 @@ struct hb_apply_context_t
{
return unlikely (idx < num_items);
}
inline bool reject (void)
{
num_items++;
}
inline bool prev (unsigned int *property_out,
unsigned int lookup_props)
{