|
|
|
@ -1729,15 +1729,14 @@ var CanvasGraphics = (function() {
@@ -1729,15 +1729,14 @@ var CanvasGraphics = (function() {
|
|
|
|
|
var fontName = descriptor.get("FontName").name; |
|
|
|
|
fontName = fontName.replace("+", "_"); |
|
|
|
|
|
|
|
|
|
var font = Fonts[fontName]; |
|
|
|
|
if (!font) { |
|
|
|
|
var fontFile = descriptor.get2("FontFile", "FontFile2"); |
|
|
|
|
if (!fontFile) |
|
|
|
|
errort("FontFile not found for font: " + fontName); |
|
|
|
|
fontFile = xref.fetchIfRef(fontFile); |
|
|
|
|
|
|
|
|
|
// Generate the custom cmap of the font if needed
|
|
|
|
|
var encodingMap = {}; |
|
|
|
|
if (fontDict.has("Encoding")) { |
|
|
|
|
|
|
|
|
|
var encoding = xref.fetchIfRef(fontDict.get("Encoding")); |
|
|
|
|
if (IsDict(encoding)) { |
|
|
|
|
// Build an map between codes and glyphs
|
|
|
|
@ -1748,8 +1747,10 @@ var CanvasGraphics = (function() {
@@ -1748,8 +1747,10 @@ var CanvasGraphics = (function() {
|
|
|
|
|
IsNum(data) ? index = data : encodingMap[index++] = data; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Get the font charset
|
|
|
|
|
var charset = descriptor.get("CharSet").split("/"); |
|
|
|
|
// Get the font charset if any
|
|
|
|
|
var charset = descriptor.get("CharSet"); |
|
|
|
|
if (charset) |
|
|
|
|
charset = charset.split("/"); |
|
|
|
|
|
|
|
|
|
} else if (IsName(encoding)) { |
|
|
|
|
var encoding = Encodings[encoding]; |
|
|
|
@ -1761,6 +1762,7 @@ var CanvasGraphics = (function() {
@@ -1761,6 +1762,7 @@ var CanvasGraphics = (function() {
|
|
|
|
|
var index = widths[j]; |
|
|
|
|
if (!index) |
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
charset.push(encoding[j + firstchar]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1772,9 +1774,12 @@ var CanvasGraphics = (function() {
@@ -1772,9 +1774,12 @@ var CanvasGraphics = (function() {
|
|
|
|
|
charset: charset, |
|
|
|
|
bbox: descriptor.get("FontBBox") |
|
|
|
|
}; |
|
|
|
|
new Font(fontName, fontFile, properties); |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
name: fontName, |
|
|
|
|
file: fontFile, |
|
|
|
|
properties: properties |
|
|
|
|
} |
|
|
|
|
return Fonts[fontName]; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
beginDrawing: function(mediaBox) { |
|
|
|
|