提交 7b84c536 编写于 作者: B Behdad Esfahbod

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.
上级 ec57e0c5
...@@ -955,7 +955,12 @@ struct MarkBasePosFormat1 ...@@ -955,7 +955,12 @@ struct MarkBasePosFormat1
/* now we search backwards for a non-mark glyph */ /* now we search backwards for a non-mark glyph */
unsigned int property; unsigned int property;
hb_apply_context_t::mark_skipping_backward_iterator_t skippy_iter (c, c->buffer->idx, 1); 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. */ /* The following assertion is too strong, so we've disabled it. */
if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH)) {/*return TRACE_RETURN (false);*/} if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH)) {/*return TRACE_RETURN (false);*/}
......
...@@ -144,6 +144,10 @@ struct hb_apply_context_t ...@@ -144,6 +144,10 @@ struct hb_apply_context_t
{ {
return unlikely (num_items && idx + num_items >= end); return unlikely (num_items && idx + num_items >= end);
} }
inline bool reject (void)
{
num_items++;
}
inline bool next (unsigned int *property_out, inline bool next (unsigned int *property_out,
unsigned int lookup_props) unsigned int lookup_props)
{ {
...@@ -189,6 +193,10 @@ struct hb_apply_context_t ...@@ -189,6 +193,10 @@ struct hb_apply_context_t
{ {
return unlikely (idx < num_items); return unlikely (idx < num_items);
} }
inline bool reject (void)
{
num_items++;
}
inline bool prev (unsigned int *property_out, inline bool prev (unsigned int *property_out,
unsigned int lookup_props) unsigned int lookup_props)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册