we love all our groups

This commit is contained in:
Rod Sheeter 2018-02-12 11:30:45 -08:00
parent 692f86e569
commit a5713bc2cb
1 changed files with 2 additions and 5 deletions

View File

@ -528,18 +528,15 @@ struct cmap
CmapSubtableLongGroup *group = nullptr;
for (unsigned int i = 0; i < codepoints.len; i++) {
hb_codepoint_t cp = codepoints[i];
if (!group)
if (!group || cp - 1 != group->endCharCode)
{
group = groups->push();
group->startCharCode.set(cp);
group->endCharCode.set(cp);
group->glyphID.set(i); // index in codepoints is new gid
} else if (cp -1 == group->endCharCode)
{
group->endCharCode.set(cp);
} else
{
group = nullptr;
group->endCharCode.set(cp);
}
}