1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-23 00:28:06 +02:00
This commit is contained in:
Artur Adib 2011-10-25 09:10:56 -07:00
parent 889de3fc4d
commit 8fbb05613e
19 changed files with 48 additions and 82 deletions

View file

@ -558,7 +558,7 @@ var CanvasGraphics = (function canvasGraphics() {
color = base.getRgb(color);
}
var pattern = new TilingPattern(IR, color, this.ctx, this.objs);
} else if (IR[0] == 'RadialAxialShading' || IR[0] == 'DummyShading') {
} else if (IR[0] == 'RadialAxial' || IR[0] == 'Dummy') {
var pattern = Pattern.shadingFromIR(this.ctx, IR);
} else {
throw 'Unkown IR type';

View file

@ -1,8 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
var ISOAdobeCharset = [
'.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar',
'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright',

View file

@ -1,8 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
var CIDToUnicodeMaps = {
'Adobe-Japan1': [[32, 160], {f: 12, c: 33}, [45, 8209], {f: 46, c: 46}, 165,
{f: 2, c: 93}, [95, 818], [96, 768], {f: 27, c: 97}, 166, 125, [732, 771],

View file

@ -1,8 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
var ERRORS = 0, WARNINGS = 1, TODOS = 5;
var verbosity = WARNINGS;

View file

@ -1,8 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
var ARCFourCipher = (function arcFourCipher() {
function constructor(key) {
this.a = 0;

View file

@ -1,7 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
var isWorker = (typeof window == 'undefined');
/**

View file

@ -1,8 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
var GlyphsUnicode = {
A: 0x0041,
AE: 0x00C6,

View file

@ -1,8 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
var Metrics = {
'Courier': 600,
'Courier-Bold': 600,

View file

@ -13,8 +13,7 @@ var Pattern = (function patternPattern() {
};
constructor.shadingFromIR = function pattern_shadingFromIR(ctx, raw) {
var obj = window[raw[0]];
return obj.fromIR(ctx, raw);
return Shadings[raw[0]].fromIR(ctx, raw);
}
constructor.parseShading = function pattern_shading(shading, matrix,
@ -27,34 +26,19 @@ var Pattern = (function patternPattern() {
case 2:
case 3:
// both radial and axial shadings are handled by RadialAxial shading
return new RadialAxialShading(dict, matrix, xref, res, ctx);
return new Shadings.RadialAxial(dict, matrix, xref, res, ctx);
default:
return new DummyShading();
return new Shadings.Dummy();
}
};
return constructor;
})();
var DummyShading = (function dummyShading() {
function constructor() {
this.type = 'Pattern';
}
constructor.fromIR = function() {
return 'hotpink';
}
constructor.prototype = {
getIR: function dummpy_getir() {
return ['DummyShading'];
}
};
return constructor;
})();
var Shadings = {};
// Radial and axial shading have very similar implementations
// If needed, the implementations can be broken into two classes
var RadialAxialShading = (function radialAxialShading() {
Shadings.RadialAxial = (function radialAxialShading() {
function constructor(dict, matrix, xref, res, ctx) {
this.matrix = matrix;
this.coordsArr = dict.get('Coords');
@ -163,13 +147,30 @@ var RadialAxialShading = (function radialAxialShading() {
p1 = Util.applyTransform(p1, matrix);
}
return ['RadialAxialShading', type, this.colorStops, p0, p1, r0, r1];
return ['RadialAxial', type, this.colorStops, p0, p1, r0, r1];
}
};
return constructor;
})();
Shadings.Dummy = (function dummyShading() {
function constructor() {
this.type = 'Pattern';
}
constructor.fromIR = function() {
return 'hotpink';
}
constructor.prototype = {
getIR: function dummpy_getir() {
return ['Dummy'];
}
};
return constructor;
})();
var TilingPattern = (function tilingPattern() {
var PAINT_TYPE_COLORED = 1, PAINT_TYPE_UNCOLORED = 2;

View file

@ -4,18 +4,15 @@
// // TODO: Global namespace
// var PDF = {};
// Stay away from global
(function(){
// Use strict in our context only - users might not want it
'use strict';
// All files will be inserted below this point
// INSERT_POINT
// Files are inserted below - see Makefile
/* INSERT_POINT */
//
// Expose API in global object
//
window.PDFDoc = PDFDoc;
window.getPdf = getPdf;
})(); // self-executing function
})();

View file

@ -1,8 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
var CFFEncodingMap = {
'0': '-reserved-',
'1': 'hstem',

View file

@ -1,8 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
/*
* The Type2 reader code below is only used for debugging purpose since Type2
* is only a CharString format and is never used directly as a Font file.

View file

@ -1,8 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
var consoleTimer = {};
var console = {
log: function log() {

View file

@ -1,9 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
function MessageHandler(name, comObj) {
this.name = name;
this.comObj = comObj;

View file

@ -1,8 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
var WorkerProcessorHandler = {
setup: function(handler) {
var pdfDoc = null;