Move the creation of canvas path fonts to the worker.

This commit is contained in:
Brendan Dahl 2013-08-19 16:33:20 -07:00
parent 81c9eeef4b
commit bb2529de03
16 changed files with 131 additions and 76 deletions

View file

@ -29,6 +29,16 @@
*/
PDFJS.maxImageSize = PDFJS.maxImageSize === undefined ? -1 : PDFJS.maxImageSize;
/**
* By default fonts are converted to OpenType fonts and loaded via font face
* rules. If disabled, the font will be rendered using a built in font renderer
* that constructs the glyphs with primitive path commands.
* @var {Boolean}
*/
PDFJS.disableFontFace = PDFJS.disableFontFace === undefined ?
false :
PDFJS.disableFontFace;
/**
* This is the main entry point for loading a PDF and interacting with it.
* NOTE: If a URL is used to fetch the PDF data a standard XMLHttpRequest(XHR)
@ -673,6 +683,9 @@ var WorkerTransport = (function WorkerTransportClosure() {
}.bind(this)
);
break;
case 'FontPath':
this.commonObjs.resolve(id, data[2]);
break;
default:
error('Got unknown common object type ' + type);
}
@ -770,7 +783,8 @@ var WorkerTransport = (function WorkerTransportClosure() {
this.messageHandler.send('GetDocRequest', {
source: source,
disableRange: PDFJS.disableRange,
maxImageSize: PDFJS.maxImageSize
maxImageSize: PDFJS.maxImageSize,
disableFontFace: PDFJS.disableFontFace
});
},