|
|
|
@ -311,13 +311,19 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
@@ -311,13 +311,19 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
|
|
|
|
|
ensureFonts: function PDFPageProxy_ensureFonts(fonts, callback) { |
|
|
|
|
this.stats.time('Font Loading'); |
|
|
|
|
// Convert the font names to the corresponding font obj.
|
|
|
|
|
var fontObjs = []; |
|
|
|
|
for (var i = 0, ii = fonts.length; i < ii; i++) { |
|
|
|
|
fonts[i] = this.objs.objs[fonts[i]].data; |
|
|
|
|
var obj = this.objs.objs[fonts[i]].data; |
|
|
|
|
if (obj.error) { |
|
|
|
|
warn('Error during font loading: ' + obj.error); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
fontObjs.push(obj); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Load all the fonts
|
|
|
|
|
FontLoader.bind( |
|
|
|
|
fonts, |
|
|
|
|
fontObjs, |
|
|
|
|
function pageEnsureFontsFontObjs(fontObjs) { |
|
|
|
|
this.stats.timeEnd('Font Loading'); |
|
|
|
|
|
|
|
|
@ -565,7 +571,12 @@ var WorkerTransport = (function WorkerTransportClosure() {
@@ -565,7 +571,12 @@ var WorkerTransport = (function WorkerTransportClosure() {
|
|
|
|
|
|
|
|
|
|
// At this point, only the font object is created but the font is
|
|
|
|
|
// not yet attached to the DOM. This is done in `FontLoader.bind`.
|
|
|
|
|
var font = new Font(name, file, properties); |
|
|
|
|
var font; |
|
|
|
|
try { |
|
|
|
|
font = new Font(name, file, properties); |
|
|
|
|
} catch (e) { |
|
|
|
|
font = new ErrorFont(e); |
|
|
|
|
} |
|
|
|
|
this.objs.resolve(id, font); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|