fontFile doesn't have to be a FlateStream. complex_ttf_font.pdf

This commit is contained in:
Julian Viereck 2011-09-08 17:23:38 -07:00
parent 2b7ff49d8d
commit 7ee894c09c

View File

@ -139,7 +139,15 @@ var WorkerPDFDoc = (function() {
var fontFile = new Stream(font.file.bytes, font.file.start, var fontFile = new Stream(font.file.bytes, font.file.start,
font.file.end - font.file.start, fontFileDict); font.file.end - font.file.start, fontFileDict);
font.file = new FlateStream(fontFile);
// Check if this is a FlateStream. Otherwise just use the created
// Stream one. This makes complex_ttf_font.pdf work.
var cmf = font.file.bytes[0];
if ((cmf & 0x0f) == 0x08) {
font.file = new FlateStream(fontFile);
} else {
font.file = fontFile;
}
} }
var images = data.images; var images = data.images;