GSTRING_DELETE (gstring, from, (len - num));
for (i = 0; i < num; i++)
{
- gstring->glyphs[from + i].c = otf->cmap->decode_table[ids[i]];
+ if (gstring->glyphs[from + i].glyph_id != ids[i])
+ {
+ gstring->glyphs[from + i].c = 0;
+ if (otf->gdef)
+ gstring->glyphs[from + i].GlyphClass
+ = get_class_def (&otf->gdef->glyph_class_def, ids[i]);
+ else
+ gstring->glyphs[from + i].GlyphClass = 0;
+ }
gstring->glyphs[from + i].glyph_id = ids[i];
- if (otf->gdef)
- gstring->glyphs[from + i].GlyphClass
- = get_class_def (&otf->gdef->glyph_class_def, ids[i]);
- else
- gstring->glyphs[from + i].GlyphClass = 0;
gstring->glyphs[from + i].positioning_type = 0;
gstring->glyphs[from + i].f.index.from = from_idx;
gstring->glyphs[from + i].f.index.to = to_idx;
int i;
if (IGNORED_GLYPH (g, flag)
- || g->positioning_type)
+ || (0 & g->positioning_type))
return (gidx + 1);
/* Try all subtables until one of them handles the current glyph. */
OTF_Glyph *nextg;
for (next_gidx = gidx + 1, nextg = gstring->glyphs + next_gidx;
- next_gidx < gstring->used && ! IGNORED_GLYPH (nextg, flag);
+ next_gidx < gstring->used && IGNORED_GLYPH (nextg, flag);
next_gidx++, nextg++);
if (next_gidx >= gstring->used
OTF_AnchorRecord *base_record;
OTF_Glyph *baseg;
int coverage_idx_base;
+ unsigned int this_flag = flag | OTF_IgnoreMarks;
for (baseg = g - 1;
- baseg >= gstring->glyphs && IGNORED_GLYPH (baseg, flag);
+ baseg >= gstring->glyphs && IGNORED_GLYPH (baseg, this_flag);
baseg--);
if (baseg < gstring->glyphs)
continue;
OTF_drive_gsub (OTF *otf, OTF_GlyphString *gstring,
const char *script, const char *language, const char *features)
{
+ if (! otf->cmap)
+ OTF_get_table (otf, "cmap");
return OTF_drive_gsub_internal (otf, gstring, script, language, features, 0);
}