Merge pull request #4354 from nnethercote/Name-cache

Use a cache to minimize the number of Name objects.
This commit is contained in:
Yury Delendik 2014-03-02 18:44:29 -06:00
commit ad4eb9a21d
8 changed files with 18 additions and 14 deletions

View file

@ -1098,7 +1098,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
// FontDescriptor is only required for Type3 fonts when the document
// is a tagged pdf. Create a barbebones one to get by.
descriptor = new Dict();
descriptor.set('FontName', new Name(type.name));
descriptor.set('FontName', Name.get(type.name));
} else {
// Before PDF 1.5 if the font was one of the base 14 fonts, having a
// FontDescriptor was not required.
@ -1146,10 +1146,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var baseFont = dict.get('BaseFont');
// Some bad pdf's have a string as the font name.
if (isString(fontName)) {
fontName = new Name(fontName);
fontName = Name.get(fontName);
}
if (isString(baseFont)) {
baseFont = new Name(baseFont);
baseFont = Name.get(baseFont);
}
if (type.name !== 'Type3') {