Merge pull request #838 from notmasteryet/to-unicode-1

Making cmap equal to ToUnicode tables
This commit is contained in:
Artur Adib 2011-11-29 10:28:50 -08:00
commit fcc05b08bf
3 changed files with 231 additions and 123 deletions

View file

@ -586,13 +586,11 @@ var CanvasGraphics = (function canvasGraphics() {
continue;
}
var unicode = glyph.unicode;
var char = (unicode >= 0x10000) ?
String.fromCharCode(0xD800 | ((unicode - 0x10000) >> 10),
0xDC00 | (unicode & 0x3FF)) : String.fromCharCode(unicode);
var char = glyph.fontChar;
ctx.fillText(char, width, 0);
width += glyph.width * fontSize * 0.001 + charSpacing;
// TODO actual characters can be extracted from the glyph.unicode
}
current.x += width;