mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge branch 'master' of git://github.com/mozilla/pdf.js.git into jpx6
Conflicts: test/test_manifest.json
This commit is contained in:
commit
f3ab505b41
8 changed files with 44 additions and 19 deletions
|
@ -832,8 +832,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
},
|
||||
setStrokeColor: function canvasGraphicsSetStrokeColor(/*...*/) {
|
||||
var cs = this.current.strokeColorSpace;
|
||||
var color = cs.getRgb(arguments);
|
||||
var color = Util.makeCssRgb.apply(null, cs.getRgb(arguments));
|
||||
var rgbColor = cs.getRgb(arguments);
|
||||
var color = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]);
|
||||
this.ctx.strokeStyle = color;
|
||||
this.current.strokeColor = color;
|
||||
},
|
||||
|
@ -870,7 +870,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
},
|
||||
setFillColor: function canvasGraphicsSetFillColor(/*...*/) {
|
||||
var cs = this.current.fillColorSpace;
|
||||
var color = Util.makeCssRgb.apply(null, cs.getRgb(arguments));
|
||||
var rgbColor = cs.getRgb(arguments);
|
||||
var color = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]);
|
||||
this.ctx.fillStyle = color;
|
||||
this.current.fillColor = color;
|
||||
},
|
||||
|
|
|
@ -292,8 +292,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
// Create an IR of the pattern code.
|
||||
var depIdx = dependencyArray.length;
|
||||
var queueObj = {};
|
||||
var codeIR = this.getIRQueue(pattern, dict.get('Resources'),
|
||||
queueObj, dependencyArray);
|
||||
var codeIR = this.getIRQueue(pattern, dict.get('Resources') ||
|
||||
resources, queueObj, dependencyArray);
|
||||
|
||||
// Add the dependencies that are required to execute the
|
||||
// codeIR.
|
||||
|
@ -336,8 +336,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
// This adds the IRQueue of the xObj to the current queue.
|
||||
var depIdx = dependencyArray.length;
|
||||
|
||||
this.getIRQueue(xobj, xobj.dict.get('Resources'), queue,
|
||||
dependencyArray);
|
||||
this.getIRQueue(xobj, xobj.dict.get('Resources') || resources,
|
||||
queue, dependencyArray);
|
||||
|
||||
// Add the dependencies that are required to execute the
|
||||
// codeIR.
|
||||
|
|
22
src/fonts.js
22
src/fonts.js
|
@ -339,6 +339,21 @@ var stdFontMap = {
|
|||
'TimesNewRomanPSMT-Italic': 'Times-Italic'
|
||||
};
|
||||
|
||||
/**
|
||||
* Holds the map of the non-standard fonts that might be included as a standard
|
||||
* fonts without glyph data.
|
||||
*/
|
||||
var nonStdFontMap = {
|
||||
'ComicSansMS': 'Comic Sans MS',
|
||||
'ComicSansMS-Bold': 'Comic Sans MS-Bold',
|
||||
'ComicSansMS-BoldItalic': 'Comic Sans MS-BoldItalic',
|
||||
'ComicSansMS-Italic': 'Comic Sans MS-Italic',
|
||||
'LucidaConsole': 'Courier',
|
||||
'LucidaConsole-Bold': 'Courier-Bold',
|
||||
'LucidaConsole-BoldItalic': 'Courier-BoldOblique',
|
||||
'LucidaConsole-Italic': 'Courier-Oblique'
|
||||
};
|
||||
|
||||
var serifFonts = {
|
||||
'Adobe Jenson': true, 'Adobe Text': true, 'Albertus': true,
|
||||
'Aldus': true, 'Alexandria': true, 'Algerian': true,
|
||||
|
@ -785,7 +800,7 @@ var Font = (function FontClosure() {
|
|||
// The file data is not specified. Trying to fix the font name
|
||||
// to be used with the canvas.font.
|
||||
var fontName = name.replace(/[,_]/g, '-');
|
||||
fontName = stdFontMap[fontName] || fontName;
|
||||
fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName;
|
||||
|
||||
this.bold = (fontName.search(/bold/gi) != -1);
|
||||
this.italic = (fontName.search(/oblique/gi) != -1) ||
|
||||
|
@ -2121,10 +2136,11 @@ var Font = (function FontClosure() {
|
|||
window.btoa(data) + ');');
|
||||
var rule = "@font-face { font-family:'" + fontName + "';src:" + url + '}';
|
||||
|
||||
var styleElement = document.createElement('style');
|
||||
document.documentElement.getElementsByTagName('head')[0].appendChild(
|
||||
document.createElement('style'));
|
||||
styleElement);
|
||||
|
||||
var styleSheet = document.styleSheets[document.styleSheets.length - 1];
|
||||
var styleSheet = styleElement.sheet;
|
||||
styleSheet.insertRule(rule, styleSheet.cssRules.length);
|
||||
|
||||
return rule;
|
||||
|
|
|
@ -94,9 +94,9 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
|
|||
|
||||
var colorStops = [];
|
||||
for (var i = t0; i <= t1; i += step) {
|
||||
var color = fn([i]);
|
||||
var rgbColor = Util.makeCssRgb.apply(this, cs.getRgb(color));
|
||||
colorStops.push([(i - t0) / diff, rgbColor]);
|
||||
var rgbColor = cs.getRgb(fn([i]));
|
||||
var cssColor = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]);
|
||||
colorStops.push([(i - t0) / diff, cssColor]);
|
||||
}
|
||||
|
||||
this.colorStops = colorStops;
|
||||
|
@ -234,9 +234,9 @@ var TilingPattern = (function TilingPatternClosure() {
|
|||
tmpCtx.strokeStyle = ctx.strokeStyle;
|
||||
break;
|
||||
case PaintType.UNCOLORED:
|
||||
color = Util.makeCssRgb.apply(this, color);
|
||||
tmpCtx.fillStyle = color;
|
||||
tmpCtx.strokeStyle = color;
|
||||
var cssColor = Util.makeCssRgb(this, color[0], color[1], color[2]);
|
||||
tmpCtx.fillStyle = cssColor;
|
||||
tmpCtx.strokeStyle = cssColor;
|
||||
break;
|
||||
default:
|
||||
error('Unsupported paint type: ' + paintType);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue