#include "otf.h"
#include "otferror.h"
+extern int debug_flag;
+
/* 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) \
OTF_Glyph *g = gstring->glyphs + gidx;
int i;
+ if (debug_flag)
+ fprintf (stderr, "[GPOS] glyph:%X lookup(%d)",
+ g->glyph_id, lookup_list_index);
if (IGNORED_GLYPH (g, flag))
- return (gidx + 1);
+ {
+ if (debug_flag)
+ fprintf (stderr, " ignored glyph\n");
+ return (gidx + 1);
+ }
/* Try all subtables until one of them handles the current glyph. */
for (i = 0; i < lookup->SubTableCount && gidx == orig_gidx; i++)
subtable = extension1->ExtensionSubtable;
}
+ if (debug_flag)
+ fprintf (stderr, " type(%d)", lookup_type);
if (subtable->Coverage.offset)
{
coverage_idx = get_coverage_index (&subtable->Coverage,
next_gidx < gstring->used && IGNORED_GLYPH (nextg, flag);
next_gidx++, nextg++);
- if (next_gidx >= gstring->used
- || nextg->positioning_type)
+ if (next_gidx >= gstring->used)
continue;
if (subtable->Format == 1)
{
= &cursive1->EntryExitRecord[coverage_idx].EntryAnchor;
g->f.f3.exit_anchor
= &cursive1->EntryExitRecord[coverage_idx].ExitAnchor;
+ gidx++;
}
break;
g->f.f4.base_anchor
= &base_record->Anchor[mark_record->Class];
g->positioning_type = lookup_type;
+ gidx++;
}
break;
g->positioning_type = lookup_type;
g->f.f5.mark_anchor = &mark_record->MarkAnchor;
g->f.f5.ligature_anchor = lig_anchor + mark_record->Class;
+ gidx++;
break;
}
}
g->f.f6.mark2_anchor
= &mark2_record->Anchor[mark1_record->Class];
g->positioning_type = lookup_type;
+ gidx++;
break;
}
break;
}
}
if (gidx == orig_gidx)
- gidx++;
+ {
+ if (debug_flag)
+ fprintf (stderr, " no match\n");
+ gidx++;
+ }
+ else if (debug_flag)
+ fprintf (stderr, " match %d glyphs\n", gidx - orig_gidx);
return gidx;
}