From: Vivien Nicolas <21@vingtetun.org> Date: Sat, 10 Sep 2011 18:12:57 +0000 (+0200) Subject: Merge with upstream X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=7fa63e68dd221b8842ddfc3debadcb29fd980e43;p=pdf.js.git Merge with upstream --- 7fa63e68dd221b8842ddfc3debadcb29fd980e43 diff --cc fonts.js index a4e16da,f3178b3..cc353c0 --- a/fonts.js +++ b/fonts.js @@@ -409,12 -444,13 +409,12 @@@ var Font = (function Font() var constructor = function font_constructor(name, file, properties) { this.name = name; this.encoding = properties.encoding; - this.glyphs = properties.glyphs; this.sizes = []; - var names = name.split("+"); + var names = name.split('+'); names = names.length > 1 ? names[1] : names[0]; names = names.split(/[-,_]/g)[0]; - this.serif = serifFonts[names] || (name.indexOf('Serif') != -1); + this.serif = serifFonts[names] || (name.search(/serif/gi) != -1); // If the font is to be ignored, register it like an already loaded font // to avoid the cost of waiting for it be be loaded by the platform. @@@ -933,14 -970,18 +933,14 @@@ if (index) { deltas.push(index); - var code = encoding[index]; - for (var glyph in properties.glyphs) { - if (properties.glyphs[glyph] == code) - break; - } - var unicode = j + kCmapGlyphOffset; - properties.glyphs[glyph] = encoding[j] = unicode; - glyphs.push({ glyph: glyph, unicode: unicode }); + var mapping = encoding[j] || {}; + mapping.unicode = unicode; + encoding[j] = mapping; + glyphs.push({ unicode: unicode }); } } - + return cmap.data = createCMapTable(glyphs, deltas); } else if (format == 6) { // Format 6 is a 2-bytes dense mapping, which means the font data