#include "otf.h"
#include "otferror.h"
-/* Return nonzero if OTF_Glyph *G should be ignored according to
- LookupFlag FLAG. */
-#define IGNORED_GLYPH(g, flag) \
- ((g)->glyph_id == 0 \
- || ((flag) & (1 << (g)->GlyphClass)) \
- || (((flag) & OTF_MarkAttachmentType) \
- && (g)->GlyphClass == OTF_GlyphClassMark \
- && ((flag) >> 8) != (g)->MarkAttachClass))
+/* Return nonzero (-1 if ID is zero, 1 otherwise) if OTF_Glyph *G
+ should be ignored according to LookupFlag FLAG. */
+#define IGNORED_GLYPH(g, flag) \
+ ((g)->glyph_id == 0 ? -1 \
+ : (((flag) & (1 << (g)->GlyphClass)) \
+ || (((flag) & OTF_MarkAttachmentType) \
+ && (g)->GlyphClass == OTF_GlyphClassMark \
+ && ((flag) >> 8) != (g)->MarkAttachClass)))
#define GSTRING_DELETE(gstring, from, len) \
do { \
for (i = non_ignored_idx = to - 1; i >= from; i--)
{
OTF_Glyph *g = gstring->glyphs + i;
- if (IGNORED_GLYPH (g, flag))
+
+ if (IGNORED_GLYPH (g, flag) == 1)
{
+ /* Move this glyph to the next of the current target of
+ substitution. */
OTF_Glyph temp = *g;
memmove (g, g + 1, sizeof (OTF_Glyph) * (non_ignored_idx - i));