mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +02:00
Treat fonts with the same font descriptor, encoding and unicode map as aliases
Different fonts can point to the same font descriptor (see https://github.com/mozilla/pdf.js/issues/4339 for details). With this commit such fonts are treated as aliases if they have also the same encoding and the same toUnicode map. The according info is stored on the font descriptor. This change must also ensure that aliases use always the same font name because translated fonts can get cleared depending on the CLEANUP_TIMEOUT setting.
This commit is contained in:
parent
608c6cea5a
commit
79f34b183c
6 changed files with 245 additions and 10 deletions
|
@ -271,6 +271,10 @@ var RefSetCache = (function RefSetCacheClosure() {
|
|||
this.dict['R' + ref.num + '.' + ref.gen] = obj;
|
||||
},
|
||||
|
||||
putAlias: function RefSetCache_putAlias(ref, aliasRef) {
|
||||
this.dict['R' + ref.num + '.' + ref.gen] = this.get(aliasRef);
|
||||
},
|
||||
|
||||
forEach: function RefSetCache_forEach(fn, thisArg) {
|
||||
for (var i in this.dict) {
|
||||
fn.call(thisArg, this.dict[i]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue