mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Make worker work again after latest font changes
This commit is contained in:
parent
2e7df01459
commit
391c26b407
2 changed files with 17 additions and 22 deletions
|
@ -59,14 +59,15 @@ FontWorker.prototype = {
|
|||
"fonts": function(data) {
|
||||
// console.log("got processed fonts from worker", Object.keys(data));
|
||||
for (name in data) {
|
||||
// Update the
|
||||
Fonts[name].properties = {
|
||||
// Update the encoding property.
|
||||
var font = Fonts.lookup(name);
|
||||
font.properties = {
|
||||
encoding: data[name].encoding
|
||||
}
|
||||
|
||||
|
||||
// Call `Font.prototype.bindDOM` to make the font get loaded on the page.
|
||||
Font.prototype.bindDOM.call(
|
||||
Fonts[name],
|
||||
font,
|
||||
data[name].str,
|
||||
// IsLoadedCallback.
|
||||
this.$handleFontLoadedCallback
|
||||
|
@ -84,19 +85,9 @@ FontWorker.prototype = {
|
|||
continue;
|
||||
}
|
||||
|
||||
// Store only the data on Fonts that is needed later on, such that we
|
||||
// hold track on as lease memory as possible.
|
||||
Fonts[font.name] = {
|
||||
name: font.name,
|
||||
mimetype: font.mimetype,
|
||||
// This is set later on the worker replay. For some fonts, the encoding
|
||||
// is calculated during the conversion process happening on the worker
|
||||
// and therefore is not available right now.
|
||||
// properties: {
|
||||
// encoding: font.properties.encoding
|
||||
// },
|
||||
cache: Object.create(null)
|
||||
};
|
||||
// Register the font but don't pass in any real data. The idea is to
|
||||
// store as less data as possible to reduce memory usage.
|
||||
Fonts.registerFont(font.name, Object.create(null), Object.create(null));
|
||||
|
||||
// Mark this font to be handled later.
|
||||
notLoaded.push(font);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue