(#919) Fixing toUnicode mapping for TrueType fonts with identity mapping

This commit is contained in:
notmasteryet 2011-12-09 21:21:58 -06:00
parent 853f16085f
commit 315b089b28
3 changed files with 13 additions and 0 deletions

View file

@ -1791,6 +1791,10 @@ var Font = (function FontClosure() {
var i = unassignedUnicodeItems[j];
while (unusedUnicode in usedUnicodes)
unusedUnicode++;
var cid = i + 1;
// override only if unicode mapping is not specified
if (!(cid in toUnicode))
toUnicode[cid] = unusedUnicode;
glyphs[i].unicode = unusedUnicode++;
}
this.useToUnicode = true;