Merge branch 'master' of git://github.com/mozilla/pdf.js.git into jpx6

Conflicts:
	test/test_manifest.json
This commit is contained in:
notmasteryet 2012-01-18 20:14:43 -06:00
commit f3ab505b41
8 changed files with 44 additions and 19 deletions

View File

@ -71,7 +71,7 @@ bundle: | $(BUILD_DIR)
cat $(PDF_JS_FILES) > all_files.tmp; \ cat $(PDF_JS_FILES) > all_files.tmp; \
sed '/PDFJSSCRIPT_INCLUDE_ALL/ r all_files.tmp' pdf.js > ../$(BUILD_TARGET); \ sed '/PDFJSSCRIPT_INCLUDE_ALL/ r all_files.tmp' pdf.js > ../$(BUILD_TARGET); \
sed -i.bak "s/PDFJSSCRIPT_BUNDLE_VER/`git log --format="%h" -n 1`/" ../$(BUILD_TARGET); \ sed -i.bak "s/PDFJSSCRIPT_BUNDLE_VER/`git log --format="%h" -n 1`/" ../$(BUILD_TARGET); \
rm -f ../$(BUILD_TARGET).bak rm -f ../$(BUILD_TARGET).bak; \
rm -f *.tmp; \ rm -f *.tmp; \
cd .. cd ..

View File

@ -832,8 +832,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
}, },
setStrokeColor: function canvasGraphicsSetStrokeColor(/*...*/) { setStrokeColor: function canvasGraphicsSetStrokeColor(/*...*/) {
var cs = this.current.strokeColorSpace; var cs = this.current.strokeColorSpace;
var color = cs.getRgb(arguments); var rgbColor = cs.getRgb(arguments);
var color = Util.makeCssRgb.apply(null, cs.getRgb(arguments)); var color = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]);
this.ctx.strokeStyle = color; this.ctx.strokeStyle = color;
this.current.strokeColor = color; this.current.strokeColor = color;
}, },
@ -870,7 +870,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
}, },
setFillColor: function canvasGraphicsSetFillColor(/*...*/) { setFillColor: function canvasGraphicsSetFillColor(/*...*/) {
var cs = this.current.fillColorSpace; 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.ctx.fillStyle = color;
this.current.fillColor = color; this.current.fillColor = color;
}, },

View File

@ -292,8 +292,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
// Create an IR of the pattern code. // Create an IR of the pattern code.
var depIdx = dependencyArray.length; var depIdx = dependencyArray.length;
var queueObj = {}; var queueObj = {};
var codeIR = this.getIRQueue(pattern, dict.get('Resources'), var codeIR = this.getIRQueue(pattern, dict.get('Resources') ||
queueObj, dependencyArray); resources, queueObj, dependencyArray);
// Add the dependencies that are required to execute the // Add the dependencies that are required to execute the
// codeIR. // codeIR.
@ -336,8 +336,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
// This adds the IRQueue of the xObj to the current queue. // This adds the IRQueue of the xObj to the current queue.
var depIdx = dependencyArray.length; var depIdx = dependencyArray.length;
this.getIRQueue(xobj, xobj.dict.get('Resources'), queue, this.getIRQueue(xobj, xobj.dict.get('Resources') || resources,
dependencyArray); queue, dependencyArray);
// Add the dependencies that are required to execute the // Add the dependencies that are required to execute the
// codeIR. // codeIR.

View File

@ -339,6 +339,21 @@ var stdFontMap = {
'TimesNewRomanPSMT-Italic': 'Times-Italic' '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 = { var serifFonts = {
'Adobe Jenson': true, 'Adobe Text': true, 'Albertus': true, 'Adobe Jenson': true, 'Adobe Text': true, 'Albertus': true,
'Aldus': true, 'Alexandria': true, 'Algerian': 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 // The file data is not specified. Trying to fix the font name
// to be used with the canvas.font. // to be used with the canvas.font.
var fontName = name.replace(/[,_]/g, '-'); var fontName = name.replace(/[,_]/g, '-');
fontName = stdFontMap[fontName] || fontName; fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName;
this.bold = (fontName.search(/bold/gi) != -1); this.bold = (fontName.search(/bold/gi) != -1);
this.italic = (fontName.search(/oblique/gi) != -1) || this.italic = (fontName.search(/oblique/gi) != -1) ||
@ -2121,10 +2136,11 @@ var Font = (function FontClosure() {
window.btoa(data) + ');'); window.btoa(data) + ');');
var rule = "@font-face { font-family:'" + fontName + "';src:" + url + '}'; var rule = "@font-face { font-family:'" + fontName + "';src:" + url + '}';
var styleElement = document.createElement('style');
document.documentElement.getElementsByTagName('head')[0].appendChild( 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); styleSheet.insertRule(rule, styleSheet.cssRules.length);
return rule; return rule;

View File

@ -94,9 +94,9 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
var colorStops = []; var colorStops = [];
for (var i = t0; i <= t1; i += step) { for (var i = t0; i <= t1; i += step) {
var color = fn([i]); var rgbColor = cs.getRgb(fn([i]));
var rgbColor = Util.makeCssRgb.apply(this, cs.getRgb(color)); var cssColor = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]);
colorStops.push([(i - t0) / diff, rgbColor]); colorStops.push([(i - t0) / diff, cssColor]);
} }
this.colorStops = colorStops; this.colorStops = colorStops;
@ -234,9 +234,9 @@ var TilingPattern = (function TilingPatternClosure() {
tmpCtx.strokeStyle = ctx.strokeStyle; tmpCtx.strokeStyle = ctx.strokeStyle;
break; break;
case PaintType.UNCOLORED: case PaintType.UNCOLORED:
color = Util.makeCssRgb.apply(this, color); var cssColor = Util.makeCssRgb(this, color[0], color[1], color[2]);
tmpCtx.fillStyle = color; tmpCtx.fillStyle = cssColor;
tmpCtx.strokeStyle = color; tmpCtx.strokeStyle = cssColor;
break; break;
default: default:
error('Unsupported paint type: ' + paintType); error('Unsupported paint type: ' + paintType);

View File

@ -0,0 +1 @@
http://mcpherrin.ca/code/mozilla/engl208b.pdf

View File

@ -9,7 +9,7 @@ USAGE_EXAMPLE = "%prog"
# The local web server uses the git repo as the document root. # The local web server uses the git repo as the document root.
DOC_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__),"..")) DOC_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__),".."))
ANAL = True GIT_CLONE_CHECK = True
DEFAULT_MANIFEST_FILE = 'test_manifest.json' DEFAULT_MANIFEST_FILE = 'test_manifest.json'
EQLOG_FILE = 'eq.log' EQLOG_FILE = 'eq.log'
BROWSERLOG_FILE = 'browser.log' BROWSERLOG_FILE = 'browser.log'
@ -344,7 +344,7 @@ def verifyPDFs(manifestList):
def setUp(options): def setUp(options):
# Only serve files from a pdf.js clone # Only serve files from a pdf.js clone
assert not ANAL or os.path.isfile('../src/pdf.js') and os.path.isdir('../.git') assert not GIT_CLONE_CHECK or os.path.isfile('../src/pdf.js') and os.path.isdir('../.git')
if options.masterMode and os.path.isdir(TMPDIR): if options.masterMode and os.path.isdir(TMPDIR):
print 'Temporary snapshot dir tmp/ is still around.' print 'Temporary snapshot dir tmp/ is still around.'

View File

@ -416,5 +416,12 @@
"md5": "d0b6137846df6e0fe058f234a87fb588", "md5": "d0b6137846df6e0fe058f234a87fb588",
"rounds": 1, "rounds": 1,
"type": "eq" "type": "eq"
},
{ "id": "issue1055",
"file": "pdfs/issue1055.pdf",
"md5": "3ba56c2e48dce81da8669b1b9cf98ff0",
"rounds": 1,
"link": true,
"type": "eq"
} }
] ]