1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Move font translation to the worker

This commit is contained in:
Yury Delendik 2012-09-12 17:31:04 -07:00
parent c9684dba32
commit 9fba150dd2
3 changed files with 37 additions and 29 deletions

View file

@ -1526,6 +1526,15 @@ function fontCharsToUnicode(charCodes, fontProperties) {
*/
var Font = (function FontClosure() {
function Font(name, file, properties) {
if (arguments.length === 1) {
// importing translated data
var data = arguments[0];
for (var i in data) {
this[i] = data[i];
}
return;
}
this.name = name;
this.coded = properties.coded;
this.charProcOperatorList = properties.charProcOperatorList;
@ -2036,6 +2045,15 @@ var Font = (function FontClosure() {
mimetype: null,
encoding: null,
export: function Font_export() {
var data = {};
for (var i in this) {
if (this.hasOwnProperty(i))
data[i] = this[i];
}
return data;
},
checkAndRepair: function Font_checkAndRepair(name, font, properties) {
function readTableEntry(file) {
var tag = file.getBytes(4);