From: = <=> Date: Tue, 4 Oct 2011 00:18:47 +0000 (-0700) Subject: fix merge conflicts X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=ff2dea38ec708954fcdd10a755d39086da21168d;p=pdf.js.git fix merge conflicts --- ff2dea38ec708954fcdd10a755d39086da21168d diff --cc pdf.js index 18368aa,2eba4e6..da6dbc0 --- a/pdf.js +++ b/pdf.js @@@ -4685,43 -4746,36 +4747,43 @@@ var PartialEvaluator = (function partia composite = true; } - // Before PDF 1.5 if the font was one of the base 14 fonts, having a - // FontDescriptor was not required. - // This case is here for compatibility. var descriptor = xref.fetchIfRef(dict.get('FontDescriptor')); if (!descriptor) { - // Note for Type3 fonts: it has no no base font, feeding default - // font name and trying to get font metrics as the same way as for - // a font without descriptor. - var baseFontName = dict.get('BaseFont') || new Name('sans-serif'); - - // Using base font name as a font name. - baseFontName = baseFontName.name.replace(/,/g, '_'); - var metricsAndMap = this.getBaseFontMetricsAndMap(baseFontName); - - var properties = { - type: type.name, - encoding: metricsAndMap.map, - differences: [], - widths: metricsAndMap.widths, - defaultWidth: metricsAndMap.defaultWidth, - firstChar: 0, - lastChar: 256 - }; - this.extractEncoding(dict, xref, properties); + if (type.name == 'Type3') { + // 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)); + } else { + // Before PDF 1.5 if the font was one of the base 14 fonts, having a + // FontDescriptor was not required. + // This case is here for compatibility. + var baseFontName = dict.get('BaseFont'); - if (!IsName(baseFontName)) ++ if (!isName(baseFontName)) + return null; + + // Using base font name as a font name. + baseFontName = baseFontName.name.replace(/,/g, '_'); + var metricsAndMap = this.getBaseFontMetricsAndMap(baseFontName); + + var properties = { + type: type.name, + encoding: metricsAndMap.map, + differences: [], + widths: metricsAndMap.widths, + defaultWidth: metricsAndMap.defaultWidth, + firstChar: 0, + lastChar: 256 + }; + this.extractEncoding(dict, xref, properties); + + return { + name: baseFontName, + dict: baseDict, + properties: properties + }; + } - return { - name: baseFontName, - dict: baseDict, - properties: properties - }; } // According to the spec if 'FontDescriptor' is declared, 'FirstChar',