1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-24 17:18:07 +02:00

Start displaying TrueType fonts

This commit is contained in:
Vivien Nicolas 2011-06-21 21:11:59 +02:00
parent ff6aaa02ee
commit 11a1ebaada
2 changed files with 12 additions and 7 deletions

9
pdf.js
View file

@ -2199,8 +2199,13 @@ var CanvasGraphics = (function() {
var tokens = [];
var token = "";
var buffer = cmapObj.ensureBuffer ? cmapObj.ensureBuffer() : cmapObj;
var cmap = cmapObj.getBytes(buffer.byteLength);
var length = cmapObj.length;
if (cmapObj instanceof FlateStream) {
cmapObj.readBlock();
length = cmapObj.bufferLength;
}
var cmap = cmapObj.getBytes(length);
for (var i =0; i < cmap.length; i++) {
var byte = cmap[i];
if (byte == 0x20 || byte == 0x0A || byte == 0x3C || byte == 0x3E) {