[ot] Add TODO re zero-len MultipleSubst sequences

This commit is contained in:
Behdad Esfahbod 2014-06-05 17:12:54 -04:00
parent f1a72fe7bf
commit b6b304f12b
2 changed files with 12 additions and 1 deletions

View File

@ -270,6 +270,15 @@ struct Sequence
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY (this);
/* TODO:
* Testing shows that Uniscribe actually allows zero-len susbstitute,
* which essentially deletes a glyph. We don't allow for now. It
* can be confusing to the client since the cluster from the deleted
* glyph won't be merged with any output cluster... Also, currently
* buffer->move_to() makes assumptions about this too. Perhaps fix
* in the future after figuring out what to do with the clusters.
*/
if (unlikely (!substitute.len)) return TRACE_RETURN (false);
unsigned int klass = _hb_glyph_info_is_ligature (&c->buffer->cur()) ?

View File

@ -995,7 +995,9 @@ static inline bool apply_lookup (hb_apply_context_t *c,
/* Recursed lookup changed buffer len. Adjust. */
/* end can't go back past the current match position. */
/* end can't go back past the current match position.
* Note: this is only true because we do NOT allow MultipleSubst
* with zero sequence len. */
end = MAX ((int) match_positions[idx] + 1, int (end) + delta);
unsigned int next = idx + 1; /* next now is the position after the recursed lookup. */