From b6b304f12be917b7449b3ac9409069fcd4a27d95 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 5 Jun 2014 17:12:54 -0400 Subject: [PATCH] [ot] Add TODO re zero-len MultipleSubst sequences --- src/hb-ot-layout-gsub-table.hh | 9 +++++++++ src/hb-ot-layout-gsubgpos-private.hh | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 3a1a0ef3d..ea761e48c 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -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()) ? diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index cd27c05b0..c8926c0fb 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -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. */