From b697001ce424dcae765cc10264bc8642fa272db8 Mon Sep 17 00:00:00 2001 From: vyv03354 Date: Sat, 23 Mar 2013 18:08:18 +0900 Subject: [PATCH 01/13] Improve TT font program parser --- src/fonts.js | 181 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 138 insertions(+), 43 deletions(-) diff --git a/src/fonts.js b/src/fonts.js index e1a90ba31..5bf4cabd2 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -3663,80 +3663,144 @@ var Font = (function FontClosure() { var TTOpsStackDeltas = [ 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, - 1, -1, -999, 0, 1, 0, 0, -2, 0, -1, -2, -1, -999, -999, -1, -1, + 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -2, 0, -2, -2, 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, - -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, + -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, - -999, -2, -2, 0, 0, -1, -2, -2, 0, -999, 0, 0, 0, -1, -2]; + -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2]; // 0xC0-DF == -1 and 0xE0-FF == -2 function sanitizeTTProgram(table, ttContext) { var data = table.data; var i = 0, n, lastEndf = 0, lastDeff = 0; var stack = []; + var callstack = []; + var functionsCalled = []; var tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions; + var inFDEF = false, ifLevel = 0, inELSE = 0; for (var ii = data.length; i < ii;) { var op = data[i++]; // The TrueType instruction set docs can be found at // https://developer.apple.com/fonts/TTRefMan/RM05/Chap5.html if (op === 0x40) { // NPUSHB - pushes n bytes n = data[i++]; - for (var j = 0; j < n; j++) { - stack.push(data[i++]); + if (inFDEF || inELSE) { + i += n; + } else { + for (var j = 0; j < n; j++) { + stack.push(data[i++]); + } } } else if (op === 0x41) { // NPUSHW - pushes n words n = data[i++]; - for (var j = 0; j < n; j++) { - var b = data[i++]; - stack.push((b << 8) | data[i++]); + if (inFDEF || inELSE) { + i += n * 2; + } else { + for (var j = 0; j < n; j++) { + var b = data[i++]; + stack.push((b << 8) | data[i++]); + } } } else if ((op & 0xF8) === 0xB0) { // PUSHB - pushes bytes n = op - 0xB0 + 1; - for (var j = 0; j < n; j++) { - stack.push(data[i++]); + if (inFDEF || inELSE) { + i += n; + } else { + for (var j = 0; j < n; j++) { + stack.push(data[i++]); + } } } else if ((op & 0xF8) === 0xB8) { // PUSHW - pushes words n = op - 0xB8 + 1; - for (var j = 0; j < n; j++) { - var b = data[i++]; - stack.push((b << 8) | data[i++]); + if (inFDEF || inELSE) { + i += n * 2; + } else { + for (var j = 0; j < n; j++) { + var b = data[i++]; + stack.push((b << 8) | data[i++]); + } } } else if (op === 0x2B && !tooComplexToFollowFunctions) { // CALL - // collecting inforamtion about which functions are used - var funcId = stack[stack.length - 1]; - ttContext.functionsUsed[funcId] = true; - if (i >= 2 && data[i - 2] === 0x2B) { - // all data in stack, calls are performed in sequence - tooComplexToFollowFunctions = true; + if (!inFDEF && !inELSE) { + // collecting inforamtion about which functions are used + var funcId = stack[stack.length - 1]; + ttContext.functionsUsed[funcId] = true; + if (funcId in ttContext.functionsStackDeltas) { + stack.length += ttContext.functionsStackDeltas[funcId]; + } else if (funcId in ttContext.functionsDefined && + functionsCalled.indexOf(funcId) < 0) { + callstack.push({data: data, i: i, stackTop: stack.length - 1}); + functionsCalled.push(funcId); + var pc = ttContext.functionsDefined[funcId]; + data = pc.data; + i = pc.i; + } } } else if (op === 0x2C && !tooComplexToFollowFunctions) { // FDEF - // collecting inforamtion about which functions are defined - lastDeff = i; - var funcId = stack[stack.length - 1]; - ttContext.functionsDefined[funcId] = true; - if (i >= 2 && data[i - 2] === 0x2D) { - // all function ids in stack, FDEF/ENDF perfomed in sequence + if (inFDEF || inELSE) { + warn('TT: nested FDEFs not allowed'); tooComplexToFollowFunctions = true; } + inFDEF = true; + // collecting inforamtion about which functions are defined + lastDeff = i; + var funcId = stack.pop(); + ttContext.functionsDefined[funcId] = {data: data, i: i}; } else if (op === 0x2D) { // ENDF - end of function - lastEndf = i; + if (inFDEF) { + inFDEF = false; + lastEndf = i; + } else { + var pc = callstack.pop(); + var funcId = functionsCalled.pop(); + data = pc.data; + i = pc.i; + ttContext.functionsStackDeltas[funcId] = + stack.length - pc.stackTop; + } } else if (op === 0x89) { // IDEF - instruction definition + if (inFDEF || inELSE) { + warn('TT: nested IDEFs not allowed'); + tooComplexToFollowFunctions = true; + } + inFDEF = true; // recording it as a function to track ENDF lastDeff = i; + } else if (op === 0x58) { // IF + ++ifLevel; + } else if (op === 0x1B) { // ELSE + inELSE = ifLevel; + } else if (op === 0x59) { // EIF + if (inELSE === ifLevel) { + inELSE = 0; + } + --ifLevel; + } else if (op === 0x1C) { // JMPR + var offset = stack[stack.length - 1]; + // only jumping forward to prevent infinite loop + if (offset > 0) { i += offset - 1; } } // Adjusting stack not extactly, but just enough to get function id - var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : - op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0; - while (stackDelta < 0 && stack.length > 0) { - stack.pop(); - stackDelta++; - } - while (stackDelta > 0) { - stack.push(NaN); // pushing any number into stack - stackDelta--; + if (!inFDEF && !inELSE) { + var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : + op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0; + if (op >= 0x71 && op <= 0x75) { + n = stack.pop(); + if (n === n) { + stackDelta = -n * 2; + } + } + while (stackDelta < 0 && stack.length > 0) { + stack.pop(); + stackDelta++; + } + while (stackDelta > 0) { + stack.push(NaN); // pushing any number into stack + stackDelta--; + } } } ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; @@ -3745,20 +3809,44 @@ var Font = (function FontClosure() { content.push(new Uint8Array(i - data.length)); } if (lastDeff > lastEndf) { + warn('TT: complementing a missing function tail'); // new function definition started, but not finished // complete function by [CLEAR, ENDF] content.push(new Uint8Array([0x22, 0x2D])); } - if (ttContext.defineMissingFunctions && !tooComplexToFollowFunctions) { + foldTTTable(table, content); + } + + function addTTDummyFunctions(table, ttContext, maxFunctionDefs) { + var content = [table.data]; + if (!ttContext.tooComplexToFollowFunctions) { + var undefinedFunctions = []; for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { if (!ttContext.functionsUsed[j] || ttContext.functionsDefined[j]) { continue; } + undefinedFunctions.push(j); + if (j >= maxFunctionDefs) { + continue; + } // function is used, but not defined - // creating empty one [PUSHB, function-id, FDEF, ENDF] - content.push(new Uint8Array([0xB0, j, 0x2C, 0x2D])); + if (j < 256) { + // creating empty one [PUSHB, function-id, FDEF, ENDF] + content.push(new Uint8Array([0xB0, j, 0x2C, 0x2D])); + } else { + // creating empty one [PUSHW, function-id, FDEF, ENDF] + content.push( + new Uint8Array([0xB8, j >> 8, j & 255, 0x2C, 0x2D])); + } + } + if (undefinedFunctions.length > 0) { + warn('TT: undefined functions: ' + undefinedFunctions); } } + foldTTTable(table, content); + } + + function foldTTTable(table, content) { if (content.length > 1) { // concatenating the content items var newLength = 0; @@ -3781,15 +3869,17 @@ var Font = (function FontClosure() { var ttContext = { functionsDefined: [], functionsUsed: [], + functionsStackDeltas: [], tooComplexToFollowFunctions: false }; + if (fpgm) { + sanitizeTTProgram(fpgm, ttContext); + } if (prep) { - // collecting prep functions info first sanitizeTTProgram(prep, ttContext); } if (fpgm) { - ttContext.defineMissingFunctions = true; - sanitizeTTProgram(fpgm, ttContext); + addTTDummyFunctions(fpgm, ttContext, maxFunctionDefs); } } @@ -3859,12 +3949,17 @@ var Font = (function FontClosure() { // Ensure the hmtx table contains the advance width and // sidebearings information for numGlyphs in the maxp table font.pos = (font.start || 0) + maxp.offset; - var version = int16(font.getBytes(4)); + var version = int32(font.getBytes(4)); var numGlyphs = int16(font.getBytes(2)); + var maxFunctionDefs = 0; + if (version >= 0x00010000 && maxp.length >= 22) { + font.pos += 14; + var maxFunctionDefs = int16(font.getBytes(2)); + } sanitizeMetrics(font, hhea, hmtx, numGlyphs); - sanitizeTTPrograms(fpgm, prep); + sanitizeTTPrograms(fpgm, prep, maxFunctionDefs); if (head) { sanitizeHead(head, numGlyphs, loca.length); From 36ea87af388b6e1aaf349fe793a8d38823973602 Mon Sep 17 00:00:00 2001 From: vyv03354 Date: Sun, 7 Apr 2013 20:57:14 +0900 Subject: [PATCH 02/13] Remove prefixed gradients usage --- web/viewer.css | 61 +++++++++----------------------------------------- 1 file changed, 11 insertions(+), 50 deletions(-) diff --git a/web/viewer.css b/web/viewer.css index 34adfbffb..a505689ce 100644 --- a/web/viewer.css +++ b/web/viewer.css @@ -254,14 +254,7 @@ html[dir='rtl'] #sidebarContent { #toolbarSidebar { width: 200px; height: 32px; - background-image: url(images/texture.png), - -webkit-linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95)); - background-image: url(images/texture.png), - -moz-linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95)); - background-image: url(images/texture.png), - -ms-linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95)); - background-image: url(images/texture.png), - -o-linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95)); + background-color: #424242; /* fallback */ background-image: url(images/texture.png), linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95)); box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25), @@ -274,15 +267,7 @@ html[dir='rtl'] #sidebarContent { #toolbarViewer, .findbar { position: relative; height: 32px; - background-color: #474747; /* IE9 */ - background-image: url(images/texture.png), - -webkit-linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); - background-image: url(images/texture.png), - -moz-linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); - background-image: url(images/texture.png), - -ms-linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); - background-image: url(images/texture.png), - -o-linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); + background-color: #474747; /* fallback */ background-image: url(images/texture.png), linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); box-shadow: inset 1px 0 0 hsla(0,0%,100%,.08), @@ -462,10 +447,6 @@ html[dir='rtl'] .splitToolbarButton > .toolbarButton { .splitToolbarButton.toggled > .toolbarButton, .toolbarButton.textButton { background-color: hsla(0,0%,0%,.12); - background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-clip: padding-box; border: 1px solid hsla(0,0%,0%,.35); @@ -600,10 +581,6 @@ html[dir='rtl'] .dropdownToolbarButton { .toolbarButton:focus, .dropdownToolbarButton { background-color: hsla(0,0%,0%,.12); - background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-clip: padding-box; border: 1px solid hsla(0,0%,0%,.35); @@ -616,10 +593,6 @@ html[dir='rtl'] .dropdownToolbarButton { .toolbarButton:hover:active, .dropdownToolbarButton:hover:active { background-color: hsla(0,0%,0%,.2); - background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); border-color: hsla(0,0%,0%,.35) hsla(0,0%,0%,.4) hsla(0,0%,0%,.45); box-shadow: 0 1px 1px hsla(0,0%,0%,.1) inset, @@ -645,10 +618,6 @@ html[dir='rtl'] .dropdownToolbarButton { .toolbarButton.toggled, .splitToolbarButton.toggled > .toolbarButton.toggled { background-color: hsla(0,0%,0%,.3); - background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); border-color: hsla(0,0%,0%,.4) hsla(0,0%,0%,.45) hsla(0,0%,0%,.5); box-shadow: 0 1px 1px hsla(0,0%,0%,.1) inset, @@ -880,7 +849,7 @@ html[dir='rtl'] .toolbarButton.pageDown::before { border: 1px solid transparent; border-radius: 2px; background-color: hsla(0,0%,100%,.09); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-clip: padding-box; border: 1px solid hsla(0,0%,0%,.35); border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42); @@ -977,7 +946,7 @@ a:focus > .thumbnail > .thumbnailSelectionRing > .thumbnailImage, a:focus > .thumbnail > .thumbnailSelectionRing, .thumbnail:hover > .thumbnailSelectionRing { background-color: hsla(0,0%,100%,.15); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-clip: padding-box; box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, 0 0 1px hsla(0,0%,100%,.2) inset, @@ -992,7 +961,7 @@ a:focus > .thumbnail > .thumbnailSelectionRing, .thumbnail.selected > .thumbnailSelectionRing { background-color: hsla(0,0%,100%,.3); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-clip: padding-box; box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, 0 0 1px hsla(0,0%,100%,.1) inset, @@ -1043,7 +1012,7 @@ html[dir='rtl'] .outlineItem > a { .outlineItem > a:hover { background-color: hsla(0,0%,100%,.02); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-clip: padding-box; box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, 0 0 1px hsla(0,0%,100%,.2) inset, @@ -1053,7 +1022,7 @@ html[dir='rtl'] .outlineItem > a { .outlineItem.selected { background-color: hsla(0,0%,100%,.08); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-clip: padding-box; box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, 0 0 1px hsla(0,0%,100%,.1) inset, @@ -1146,8 +1115,7 @@ canvas { height: 25px; background-color: hsla(0,0%,0%,.3); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); border: 1px solid #000; box-shadow: 0 1px 1px hsla(0,0%,0%,.1) inset, 0 0 1px hsla(0,0%,0%,.2) inset, @@ -1159,12 +1127,7 @@ canvas { float: left; background: #666; - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b2b2b2), color-stop(100%,#898989)); - background: -webkit-linear-gradient(top, #b2b2b2 0%,#898989 100%); - background: -moz-linear-gradient(top, #b2b2b2 0%,#898989 100%); - background: -ms-linear-gradient(top, #b2b2b2 0%,#898989 100%); - background: -o-linear-gradient(top, #b2b2b2 0%,#898989 100%); - background: linear-gradient(top, #b2b2b2 0%,#898989 100%); + background: linear-gradient(#b2b2b2 0%,#898989 100%); border-top-left-radius: 2px; border-bottom-left-radius: 2px; @@ -1181,10 +1144,8 @@ canvas { #loadingBar .progress.indeterminate { width: 100%; height: 25px; - background-image: -moz-linear-gradient( 30deg, #404040, #404040 15%, #898989, #404040 85%, #404040); - background-image: -webkit-linear-gradient( 30deg, #404040, #404040 15%, #898989, #404040 85%, #404040); - background-image: -ms-linear-gradient( 30deg, #404040, #404040 15%, #898989, #404040 85%, #404040); - background-image: -o-linear-gradient( 30deg, #404040, #404040 15%, #898989, #404040 85%, #404040); + background-color: #666; + background-image: linear-gradient(60deg, #404040, #404040 15%, #898989, #404040 85%, #404040); background-size: 75px 25px; -moz-animation: progressIndeterminate 1s linear infinite; -webkit-animation: progressIndeterminate 1s linear infinite; From ecb04c8bbe4abb84d24865b9caa3062a5e06b278 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Thu, 11 Apr 2013 11:19:42 -0700 Subject: [PATCH 03/13] Use at least 1x1 pixel canvas for groups. --- src/canvas.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/canvas.js b/src/canvas.js index 6dd5b2b03..8ce8e6f1f 100644 --- a/src/canvas.js +++ b/src/canvas.js @@ -1422,9 +1422,10 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { group.bbox, currentCtx.mozCurrentTransform); // Use ceil in case we're between sizes so we don't create canvas that is - // too small. - var drawnWidth = Math.ceil(bounds[2] - bounds[0]); - var drawnHeight = Math.ceil(bounds[3] - bounds[1]); + // too small and make the canvas at least 1x1 pixels. + var drawnWidth = Math.max(Math.ceil(bounds[2] - bounds[0]), 1); + var drawnHeight = Math.max(Math.ceil(bounds[3] - bounds[1]), 1); + var scratchCanvas = createScratchCanvas(drawnWidth, drawnHeight); var groupCtx = scratchCanvas.getContext('2d'); addContextCurrentTransform(groupCtx); From eeacb9e7a4fb30b1e3e603af59daf3b5ac348ff3 Mon Sep 17 00:00:00 2001 From: Adolfo Jayme Barrientos Date: Fri, 12 Apr 2013 06:34:31 -0500 Subject: [PATCH 04/13] Update Spanish l10n Not removing es_MX for now. Would it be a good idea to create symlinks or something like that? --- l10n/es/chrome.properties | 18 +++ l10n/es/viewer.properties | 227 +++++++++++++++++++++----------------- 2 files changed, 141 insertions(+), 104 deletions(-) create mode 100644 l10n/es/chrome.properties diff --git a/l10n/es/chrome.properties b/l10n/es/chrome.properties new file mode 100644 index 000000000..31c36187c --- /dev/null +++ b/l10n/es/chrome.properties @@ -0,0 +1,18 @@ +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Chrome notification bar messages and buttons +unsupported_feature=Es posible que este documento PDF no se muestre correctamente. +open_with_different_viewer=Abrir con un visor diferente +open_with_different_viewer.accessKey=a diff --git a/l10n/es/viewer.properties b/l10n/es/viewer.properties index 7125ccc05..059eed69a 100644 --- a/l10n/es/viewer.properties +++ b/l10n/es/viewer.properties @@ -1,104 +1,123 @@ -# Copyright 2012 Mozilla Foundation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Main toolbar buttons (tooltips and alt text for images) -previous.title=Página anterior -previous_label=Anterior -next.title=Página siguiente -next_label=Siguiente - -# LOCALIZATION NOTE (page_label, page_of): -# These strings are concatenated to form the "Page: X of Y" string. -# Do not translate "{{pageCount}}", it will be substituted with a number -# representing the total number of pages. -page_label=Página: -page_of=de {{pageCount}} - -zoom_out.title=Reducir -zoom_out_label=Reducir -zoom_in.title=Ampliar -zoom_in_label=Ampliar -zoom.title=Ampliación -print.title=Imprimir -print_label=Imprimir -fullscreen.title=Pantalla completa -fullscreen_label=Pantalla completa -open_file.title=Abrir archivo -open_file_label=Abrir -download.title=Descargar -download_label=Descargar -bookmark.title=Vista actual (copie o abra en una ventana nueva) -bookmark_label=Vista actual - -# Tooltips and alt text for side panel toolbar buttons -# (the _label strings are alt text for the buttons, the .title strings are -# tooltips) -toggle_slider.title=Alternar deslizador -toggle_slider_label=Alternar deslizador -outline.title=Mostrar esquema del documento -outline_label=Esquema del documento -thumbs.title=Mostrar miniaturas -thumbs_label=Miniaturas -findbar.title=Buscar en el documento -findbar_label=Buscar - -# Thumbnails panel item (tooltip and alt text for images) -# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page -# number. -thumb_page_title=Página {{page}} -# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page -# number. -thumb_page_canvas=Miniatura de la página {{page}} - -# Find panel button title and messages -find=Buscar -find_terms_not_found=(No encontrado) - -# Error panel labels -error_more_info=Más información -error_less_info=Menos información -error_close=Cerrar -# LOCALIZATION NOTE (error_build): "{{build}}" will be replaced by the PDF.JS -# build ID. -error_build=Compilación de PDF.JS: {{build}} -# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an -# english string describing the error. -error_message=Mensaje: {{message}} -# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack -# trace. -error_stack=Pila: {{stack}} -# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename -error_file=Archivo: {{file}} -# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number -error_line=Línea: {{line}} -rendering_error=Ocurrió un error mientras se renderizaba la página. - -# Predefined zoom values -page_scale_width=Anchura de página -page_scale_fit=Ajustar a la página -page_scale_auto=Ampliación automática -page_scale_actual=Tamaño real - -# Loading indicator messages -loading_error_indicator=Error -loading_error=Ocurrió un error mientras se cargaba el PDF. - -# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip. -# "{{type}}" will be replaced with an annotation type from a list defined in -# the PDF spec (32000-1:2008 Table 169 – Annotation types). -# Some common types are e.g.: "Check", "Text", "Comment", "Note" -text_annotation_type=[Anotación {{type}}] -request_password=El PDF está protegido con una contraseña: - -printing_not_supported=Aviso: La impresión no es compatible totalmente con este navegador. +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Main toolbar buttons (tooltips and alt text for images) +previous.title=Página anterior +previous_label=Anterior +next.title=Página siguiente +next_label=Siguiente + +# LOCALIZATION NOTE (page_label, page_of): +# These strings are concatenated to form the "Page: X of Y" string. +# Do not translate "{{pageCount}}", it will be substituted with a number +# representing the total number of pages. +page_label=Página: +page_of=de {{pageCount}} + +zoom_out.title=Reducir +zoom_out_label=Reducir +zoom_in.title=Aumentar +zoom_in_label=Aumentar +zoom.title=Ampliación +print.title=Imprimir +print_label=Imprimir +presentation_mode.title=Cambiar al modo de presentación +presentation_mode_label=Modo de presentación +open_file.title=Abrir un archivo +open_file_label=Abrir +download.title=Descargar +download_label=Descargar +bookmark.title=Vista actual (copie o abra en una ventana nueva) +bookmark_label=Vista actual + +# Tooltips and alt text for side panel toolbar buttons +# (the _label strings are alt text for the buttons, the .title strings are +# tooltips) +toggle_sidebar.title=Mostrar u ocultar la barra lateral +toggle_sidebar_label=Conmutar la barra lateral +outline.title=Mostrar el esquema del documento +outline_label=Esquema del documento +thumbs.title=Mostrar las miniaturas +thumbs_label=Miniaturas +findbar.title=Buscar en el documento +findbar_label=Buscar + +# Thumbnails panel item (tooltip and alt text for images) +# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page +# number. +thumb_page_title=Página {{page}} +# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page +# number. +thumb_page_canvas=Miniatura de la página {{page}} + +# Context menu +first_page.label=Ir a la primera página +last_page.label=Ir a la última página +page_rotate_cw.label=Girar a la derecha +page_rotate_ccw.label=Girar a la izquierda + +# Find panel button title and messages +find_label=Buscar: +find_previous.title=Ir a la frase encontrada anterior +find_previous_label=Anterior +find_next.title=Ir a la frase encontrada siguiente +find_next_label=Siguiente +find_highlight=Resaltar todo +find_match_case_label=Coincidir mayúsculas y minúsculas +find_reached_top=Se alcanzó el inicio del documento, se continúa desde el final +find_reached_bottom=Se alcanzó el final del documento, se continúa desde el inicio +find_not_found=No se encontró la frase + +# Error panel labels +error_more_info=Más información +error_less_info=Menos información +error_close=Cerrar +# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be +# replaced by the PDF.JS version and build ID. +error_version_info=PDF.js v{{version}} (compilación: {{build}}) +# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an +# english string describing the error. +error_message=Mensaje: {{message}} +# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack +# trace. +error_stack=Pila: {{stack}} +# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename +error_file=Archivo: {{file}} +# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number +error_line=Línea: {{line}} +rendering_error=Ocurrió un error al renderizar la página. + +# Predefined zoom values +page_scale_width=Anchura de la página +page_scale_fit=Ajustar a la página +page_scale_auto=Ampliación automática +page_scale_actual=Tamaño real + +# Loading indicator messages +loading_error_indicator=Error +loading_error=Ocurrió un error al cargar el PDF. +invalid_file_error=El archivo PDF no es válido o está dañado. +missing_file_error=Falta el archivo PDF. + +# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip. +# "{{type}}" will be replaced with an annotation type from a list defined in +# the PDF spec (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +text_annotation_type=[Anotación {{type}}] +request_password=El archivo PDF está protegido por una contraseña: + +printing_not_supported=Aviso: Este navegador no es compatible completamente con la impresión. +printing_not_ready=Aviso: El PDF no se ha cargado completamente para su impresión. +web_fonts_disabled=Se han desactivado los tipos de letra web: no se pueden usar los tipos de letra incrustados en el PDF. +web_colors_disabled=Se han desactivado los colores web. From 3cba5a0c8a6bc536f71268c32d84b4a1b045a548 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Mon, 15 Apr 2013 16:14:07 -0700 Subject: [PATCH 05/13] Normalize CFF CID sub matrices to work on windows. --- src/fonts.js | 29 ++++++++++++++++++++++++++++- src/util.js | 12 ++++++++++++ test/pdfs/issue3061.pdf | Bin 0 -> 17022 bytes test/test_manifest.json | 7 +++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 test/pdfs/issue3061.pdf diff --git a/src/fonts.js b/src/fonts.js index 3cfdba094..330210b28 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -17,7 +17,7 @@ /* globals assert, bytesToString, CIDToUnicodeMaps, error, ExpertCharset, ExpertSubsetCharset, FileReaderSync, globalScope, GlyphsUnicode, info, isArray, isNum, ISOAdobeCharset, isWorker, PDFJS, Stream, - stringToBytes, TextDecoder, TODO, warn, Lexer */ + stringToBytes, TextDecoder, TODO, warn, Lexer, Util */ 'use strict'; @@ -6696,6 +6696,33 @@ var CFFCompiler = (function CFFCompilerClosure() { var nameIndex = this.compileNameIndex(cff.names); output.add(nameIndex); + if (cff.isCIDFont) { + // The spec is unclear on how font matrices should relate to each other + // when there is one in the main top dict and the sub top dicts. + // Windows handles this differently than linux and osx so we have to + // normalize to work on all. + // Rules based off of some mailing list discussions: + // - If main font has a matrix and subfont doesn't, use the main matrix. + // - If no main font matrix and there is a subfont matrix, use the + // subfont matrix. + // - If both have matrices, concat together. + // - If neither have matrices, use default. + // To make this work on all platforms we move the top matrix into each + // sub top dict and concat if necessary. + if (cff.topDict.hasName('FontMatrix')) { + var base = cff.topDict.getByName('FontMatrix'); + cff.topDict.removeByName('FontMatrix'); + for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { + var subDict = cff.fdArray[i]; + var matrix = base.slice(0); + if (subDict.hasName('FontMatrix')) { + matrix = Util.transform(matrix, subDict.getByName('FontMatrix')); + } + subDict.setByName('FontMatrix', matrix); + } + } + } + var compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont); diff --git a/src/util.js b/src/util.js index c29699f7d..8706b27fb 100644 --- a/src/util.js +++ b/src/util.js @@ -223,6 +223,18 @@ var Util = PDFJS.Util = (function UtilClosure() { return Util.makeCssCmyk(cmyk); }; + // Concatenates two transformation matrices together and returns the result. + Util.transform = function Util_transform(m1, m2) { + return [ + m1[0] * m2[0] + m1[2] * m2[1], + m1[1] * m2[0] + m1[3] * m2[1], + m1[0] * m2[2] + m1[2] * m2[3], + m1[1] * m2[2] + m1[3] * m2[3], + m1[0] * m2[4] + m1[2] * m2[5] + m1[4], + m1[1] * m2[4] + m1[3] * m2[5] + m1[5] + ]; + }; + // For 2d affine transforms Util.applyTransform = function Util_applyTransform(p, m) { var xt = p[0] * m[0] + p[1] * m[2] + m[4]; diff --git a/test/pdfs/issue3061.pdf b/test/pdfs/issue3061.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4c16f7c58f7606f9d01fe43120668eff9f680d0a GIT binary patch literal 17022 zcmeHvby(Ej_O3_?2nZsf#7Or9Lx++wbV)Z14Ku*dDJd=8(jwg;T_OU~CEcB(ln7k> z_BrQ!&%Nh)e)s-$=C93X@4fa~@4NP%=QHegF(^q$aez5_@EMj@21oI6c>y2*!q^I5 zNC+rrX$LoQuylu;0>D5y0GJm9fdCZ&{6I+nmzkOJ^> z{~itx6sQW|;{OL14Gj%VZhSPob=#jEOReqhd-l7O_;OUzel|*<+FrG_bth$$1H2b; z(MLmZl<*}pUO+#-6TXFpb!(3L4%xqY`V*etQb-<-GBPzn83Dk*K&E754tE6nWMAc1 z*u-!8Y!K#uCJg_dbHx#MD7YQU5di*mvbX~RDTZ*>0o@GY=I7>w@Bwb<=H%no1Ipjz ziqZe3?rf?wK74hR!fI7$b2 zvps-na97j~sW;^RG92`)?>~e2({b=mw|+^(ryz5%cLYd6gNt7U#3V>i+Ijz#h4QsUhlm*6D1P!` zTq|)9Hzv}{eMg*M0xMW4<=W2I780$s8e+`BzkytiM0QskNW^wf$Mcxl*Cojn5<5&w z&E^V`!OT=6sBh`WE8yhD#_??ye9Y^s2ImrGf#mm|QsSGvi-St%alDIrYB(tq3r!@! zqAD0e3!V$$WQWBmlebDSNnt%9`)Y~GPVb8t$X&{9??8$X&2wC|{b}n?~ez<#R#qdFTjg9kJ5zWw^5i`9YK9GqAs7TZNuDMbknfTW^m?UTL!*$Ka>2qrMQK6X0uE5l2;&!_#i!ZQr8+lX$j%$ z_zQHs8fvA#aUb$;_snnZL;iYNxu)qwi`t<-zAJf}=J)7sP!Dr7El&?)nELY>JdhzR z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Dptpy5&6aWHUTwFL^xHu6G=0Gq%KR*xz z0YV@gHzPP4-Rw|Ct{irbbiW$;-Hrs@(ZsBQRoH}0eOU}rJ0+=jTA%VCMqrt5R?PVtp?^1 z0PzcO@pFK91wbGn;6IK0bLC%bh~EfqZlpnfV}nnC>&E1tHvTg5pKSb2_1{_f7f*gu zw)`^oH#wntI8$#se|8VqgskXKKM?Zg=A|QbT6!-NZJ#9<6K0da7daq)8-8^O7tW+uPzFE9Vsx&O%C zO&`qeMkHlt0{`8vnW+i436~KU2QQQl#9;)7ns69_jZ8Vr%%EIGe0(4 ze;TJ78vY)on~obQx&9HNn}-57>LXJp6S#xOGbK5|GYfet-|;O7KEg?{q-=a7Hv z?XMYma|qm=Kfpf@px@K-kB$5Pr12*`|4+>SYV^O0{72ya7q0)p^&cVd9}WI*cKsKw z{|JHqXz+it>wgR`+&^DoZq((%v@SOI>Ojt77o;>fcG|Dlu4ZUy zgQIazDK0}LB~3ebiFz?-@pZI;u1cD2oR(6yVS%|}wxv1tJ;Pf}?NqRT_5Ck`%D*pm z!1e#P*ug&+IJha^@Xu8Ze$%D@rKkbupNbmXlngM2e(!nTmjC{J+fe`ews*lH_Sd%o csYHObTM#1*l7GeF&jJQu@J+diUrHGKFMp#O#sB~S literal 0 HcmV?d00001 diff --git a/test/test_manifest.json b/test/test_manifest.json index 68fbc7009..a1ce04f51 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -883,6 +883,13 @@ "lastPage": 4, "type": "load" }, + { "id": "issue3061", + "file": "pdfs/issue3061.pdf", + "md5": "696a7cb1b194d095ca3f7861779a606b", + "rounds": 1, + "type": "eq", + "about": "CFF CID font with font matrices in main top dict and sub top dict." + }, { "id": "issue1878", "file": "pdfs/issue1878.pdf", "md5": "b4fb0ce7c19368e7104dce3d0d34bcb3", From 15a9ab34d3f499024c1ba34000e3bda3be9defc6 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Tue, 16 Apr 2013 15:45:29 -0700 Subject: [PATCH 06/13] Lower two common warnings to info. --- src/canvas.js | 4 ++-- src/evaluator.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/canvas.js b/src/canvas.js index 6dd5b2b03..49bc62d52 100644 --- a/src/canvas.js +++ b/src/canvas.js @@ -16,7 +16,7 @@ */ /* globals ColorSpace, DeviceCmykCS, DeviceGrayCS, DeviceRgbCS, error, FONT_IDENTITY_MATRIX, IDENTITY_MATRIX, ImageData, isArray, isNum, - isString, Pattern, TilingPattern, TODO, Util, warn, assert */ + isString, Pattern, TilingPattern, TODO, Util, warn, assert, info */ 'use strict'; @@ -1401,7 +1401,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { // - remove background color: // colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew) if (!group.isolated) { - TODO('Support non-isolated groups.'); + info('TODO: Support non-isolated groups.'); } // TODO knockout - supposedly possible with the clever use of compositing diff --git a/src/evaluator.js b/src/evaluator.js index 2f94f41d0..acbfb8357 100644 --- a/src/evaluator.js +++ b/src/evaluator.js @@ -1341,7 +1341,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { var fontNameStr = fontName && fontName.name; var baseFontStr = baseFont && baseFont.name; if (fontNameStr !== baseFontStr) { - warn('The FontDescriptor\'s FontName is "' + fontNameStr + + info('The FontDescriptor\'s FontName is "' + fontNameStr + '" but should be the same as the Font\'s BaseFont "' + baseFontStr + '"'); } From 3b9455071225640cacac405e69329210d0a7825a Mon Sep 17 00:00:00 2001 From: haison Date: Wed, 17 Apr 2013 14:05:35 +0900 Subject: [PATCH 07/13] Vietnamese language --- l10n/vi/chrome.properties | 18 ++++++ l10n/vi/metadata.inc | 8 +++ l10n/vi/viewer.properties | 123 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 l10n/vi/chrome.properties create mode 100644 l10n/vi/metadata.inc create mode 100644 l10n/vi/viewer.properties diff --git a/l10n/vi/chrome.properties b/l10n/vi/chrome.properties new file mode 100644 index 000000000..0770f7a9e --- /dev/null +++ b/l10n/vi/chrome.properties @@ -0,0 +1,18 @@ +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Chrome notification bar messages and buttons +unsupported_feature=Tài liệu PDF có thể hiện thị không chính xác. +open_with_different_viewer=Mở với chương trình xem khác +open_with_different_viewer.accessKey=o diff --git a/l10n/vi/metadata.inc b/l10n/vi/metadata.inc new file mode 100644 index 000000000..0c8653cd9 --- /dev/null +++ b/l10n/vi/metadata.inc @@ -0,0 +1,8 @@ + + + vi-VN + Trình Xem PDF + Dùng HTML5 để hiện trị PDF trực giao trên FireFox. + + + diff --git a/l10n/vi/viewer.properties b/l10n/vi/viewer.properties new file mode 100644 index 000000000..fa473234e --- /dev/null +++ b/l10n/vi/viewer.properties @@ -0,0 +1,123 @@ +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Main toolbar buttons (tooltips and alt text for images) +previous.title=Trang Trước +previous_label=Trước +next.title=Trang Tiếp +next_label=Tiếp + +# LOCALIZATION NOTE (page_label, page_of): +# These strings are concatenated to form the "Page: X of Y" string. +# Do not translate "{{pageCount}}", it will be substituted with a number +# representing the total number of pages. +page_label=Trang: +page_of=trên {{pageCount}} + +zoom_out.title=Phóng to +zoom_out_label=Phóng to +zoom_in.title=Thu nhỏ +zoom_in_label=Thu nhỏ +zoom.title=Thu phóng +print.title=In +print_label=In +presentation_mode.title=Chuyển sang chế độ thuyết trình +presentation_mode_label=Chế độ Thuyết trình +open_file.title=Mở Tệp +open_file_label=Tệp +download.title=Tải xuống +download_label=Tải xuống +bookmark.title=Đánh dấu (sao chép hoặc mở cửa sổ mới) +bookmark_label=Đánh dấu + +# Tooltips and alt text for side panel toolbar buttons +# (the _label strings are alt text for the buttons, the .title strings are +# tooltips) +toggle_sidebar.title=Đóng bật thanh lề +toggle_sidebar_label=Bật tắt thanh lề +outline.title=Hiện thị giản lược tài liệu +outline_label=Giản lược +thumbs.title=hiện tài liệu ở dạng ảnh thu nhỏ +thumbs_label=Ảnh thu nhỏ +findbar.title=Tìm trong văn bản +findbar_label=Tìm kiếm + +# Thumbnails panel item (tooltip and alt text for images) +# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page +# number. +thumb_page_title=Page {{page}} +# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page +# number. +thumb_page_canvas=Thumbnail of Page {{page}} + +# Context menu +first_page.label=Đến trang đầu tiên +last_page.label=Đến trang cuối cùng +page_rotate_cw.label=Quay sang phải +page_rotate_ccw.label=Quay sang trái + +# Find panel button title and messages +find_label=Tìm: +find_previous.title=Tìm kiếm câu xuất hiện phía trước +find_previous_label=Về trước +find_next.title=Tìm kiếm câu xuất hiện phía sau +find_next_label=Tiếp theo +find_highlight=Tô sáng toàn bộ +find_match_case_label=Giống chữ +find_reached_top=Đến cuối đầu tài liệu, tiếp tục từ cuối +find_reached_bottom=Đến cuối tài liệu, tiếp tục từ đầu +find_not_found=Không tìm thấy + +# Error panel labels +error_more_info=Thông tim thêm +error_less_info=Thông tin giản lược +error_close=Đóng +# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be +# replaced by the PDF.JS version and build ID. +error_version_info=PDF.js v{{version}} (dịch: {{build}}) +# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an +# english string describing the error. +error_message=Thông báo: {{message}} +# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack +# trace. +error_stack=Ngăn xếp: {{stack}} +# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename +error_file=Tệp: {{file}} +# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number +error_line=Dòng: {{line}} +rendering_error=An error occurred while rendering the page. + +# Predefined zoom values +page_scale_width=Ngang +page_scale_fit=Xem Toàn Trang +page_scale_auto=Tự Động +page_scale_actual=Kích thước thực + +# Loading indicator messages +loading_error_indicator=Lỗi +loading_error=Lỗi khi mở tệp PDF. +invalid_file_error=Tệp PDF bị hỏng hoặc lỗi. +missing_file_error=Thiếu tệp tin PDF. + +# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip. +# "{{type}}" will be replaced with an annotation type from a list defined in +# the PDF spec (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +text_annotation_type=[{{type}} Đánh dấu] +request_password=PDF được bảo vệ bởi mật mã: + +printing_not_supported=Chú ý: Công việc in ẩn không được hỗ trợ bởi trình duyệt. +printing_not_ready=Chú ý: Tệp PDF không sẵn sàng cho in ấn. +web_fonts_disabled=Phồng chữ cho Web bị vô tác dụng: không thể dùng phông chữ kèm theo tệp PDF. +web_colors_disabled=Màu cho Wev bị vô tác dụng. From 0f4fe7f762e60b3add20d7c7d6584b14212a4db1 Mon Sep 17 00:00:00 2001 From: Mack Duan Date: Wed, 24 Apr 2013 10:38:55 -0700 Subject: [PATCH 08/13] Remove redundant log in network.js --- src/network.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/network.js b/src/network.js index 44e3847dd..161833477 100644 --- a/src/network.js +++ b/src/network.js @@ -33,10 +33,6 @@ // // TODO(mack): dump() doesn't seem to work here... // dump(msg + '\n'); //} -//#else -function log(aMsg) { - console.log(aMsg); -} //#endif var NetworkManager = (function NetworkManagerClosure() { From f524eaefe24e08415fa7c8c88bd39bdfce4bd009 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 24 Apr 2013 21:02:33 -0400 Subject: [PATCH 09/13] Remove DOM window URI check Per discussion in #2937 --- .../firefox/components/PdfStreamConverter.js | 47 +++++++++---------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/extensions/firefox/components/PdfStreamConverter.js b/extensions/firefox/components/PdfStreamConverter.js index 23fd7b4c7..5332fb779 100644 --- a/extensions/firefox/components/PdfStreamConverter.js +++ b/extensions/firefox/components/PdfStreamConverter.js @@ -765,33 +765,28 @@ PdfStreamConverter.prototype = { // We get the DOM window here instead of before the request since it // may have changed during a redirect. var domWindow = getDOMWindow(channel); - // Double check the url is still the correct one. - if (domWindow.document.documentURIObject.equals(aRequest.URI)) { - var actions; - if (rangeRequest) { - // We are going to be issuing range requests, so cancel the - // original request - aRequest.resume(); - aRequest.cancel(Cr.NS_BINDING_ABORTED); - actions = new RangedChromeActions(domWindow, - contentDispositionFilename, aRequest); - } else { - actions = new StandardChromeActions( - domWindow, contentDispositionFilename, dataListener); - } - var requestListener = new RequestListener(actions); - domWindow.addEventListener(PDFJS_EVENT_ID, function(event) { - requestListener.receive(event); - }, false, true); - if (actions.supportsIntegratedFind()) { - var chromeWindow = getChromeWindow(domWindow); - var findEventManager = new FindEventManager(chromeWindow.gFindBar, - domWindow, - chromeWindow); - findEventManager.bind(); - } + var actions; + if (rangeRequest) { + // We are going to be issuing range requests, so cancel the + // original request + aRequest.resume(); + aRequest.cancel(Cr.NS_BINDING_ABORTED); + actions = new RangedChromeActions(domWindow, + contentDispositionFilename, aRequest); } else { - log('Dom window url did not match request url.'); + actions = new StandardChromeActions( + domWindow, contentDispositionFilename, dataListener); + } + var requestListener = new RequestListener(actions); + domWindow.addEventListener(PDFJS_EVENT_ID, function(event) { + requestListener.receive(event); + }, false, true); + if (actions.supportsIntegratedFind()) { + var chromeWindow = getChromeWindow(domWindow); + var findEventManager = new FindEventManager(chromeWindow.gFindBar, + domWindow, + chromeWindow); + findEventManager.bind(); } listener.onStopRequest(aRequest, context, statusCode); } From d42bd1c7e0e1ac699b08dc49c68c276c5aaae0da Mon Sep 17 00:00:00 2001 From: mete0r Date: Thu, 25 Apr 2013 13:40:27 +0900 Subject: [PATCH 10/13] Korean language (ko) --- l10n/ko/chrome.properties | 18 ++++++ l10n/ko/metadata.inc | 8 +++ l10n/ko/viewer.properties | 123 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 l10n/ko/chrome.properties create mode 100644 l10n/ko/metadata.inc create mode 100644 l10n/ko/viewer.properties diff --git a/l10n/ko/chrome.properties b/l10n/ko/chrome.properties new file mode 100644 index 000000000..fcd2f8f4f --- /dev/null +++ b/l10n/ko/chrome.properties @@ -0,0 +1,18 @@ +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Chrome notification bar messages and buttons +unsupported_feature=이 PDF 문서는 제대로 표시되지 않을 수 있습니다. +open_with_different_viewer=다른 뷰어로 열기 +open_with_different_viewer.accessKey=o diff --git a/l10n/ko/metadata.inc b/l10n/ko/metadata.inc new file mode 100644 index 000000000..04a8f0786 --- /dev/null +++ b/l10n/ko/metadata.inc @@ -0,0 +1,8 @@ + + + ko + PDF 뷰어 + Firefox가 PDF 파일을 HTML5를 이용하여 직접 보여줍니다. + + + diff --git a/l10n/ko/viewer.properties b/l10n/ko/viewer.properties new file mode 100644 index 000000000..240a15138 --- /dev/null +++ b/l10n/ko/viewer.properties @@ -0,0 +1,123 @@ +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Main toolbar buttons (tooltips and alt text for images) +previous.title=이전 쪽 +previous_label=이전 +next.title=다음 쪽 +next_label=다음 + +# LOCALIZATION NOTE (page_label, page_of): +# These strings are concatenated to form the "Page: X of Y" string. +# Do not translate "{{pageCount}}", it will be substituted with a number +# representing the total number of pages. +page_label=쪽: +page_of=/ {{pageCount}} + +zoom_out.title=축소 +zoom_out_label=축소 +zoom_in.title=확대 +zoom_in_label=확대 +zoom.title=확대 비율 +print.title=출력 +print_label=출력 +presentation_mode.title=프레젠테이션 모드로 전환 +presentation_mode_label=프레젠테이션 모드 +open_file.title=파일 열기 +open_file_label=열기 +download.title=내려받기 +download_label=내려받기 +bookmark.title=현 화면 (복사하거나 새 창에서 열기) +bookmark_label=현 화면 + +# Tooltips and alt text for side panel toolbar buttons +# (the _label strings are alt text for the buttons, the .title strings are +# tooltips) +toggle_sidebar.title=사이드바 보이기/숨기기 +toggle_sidebar_label=사이드바 보이기/숨기기 +outline.title=문서 개요 보이기 +outline_label=문서 개요 +thumbs.title=쪽 작게 보기 +thumbs_label=쪽 작게 보기 +findbar.title=문서 내에서 찾기 +findbar_label=찾기 + +# Thumbnails panel item (tooltip and alt text for images) +# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page +# number. +thumb_page_title={{page}} 쪽 +# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page +# number. +thumb_page_canvas={{page}}쪽의 썸네일 + +# Context menu +first_page.label=첫 쪽으로 +last_page.label=끝 쪽으로 +page_rotate_cw.label=시계방향 회전 +page_rotate_ccw.label=반시계방향 회전 + +# Find panel button title and messages +find_label=찾기: +find_previous.title=이전 구절 찾기 +find_previous_label=이전 +find_next.title=다음 구절 찾기 +find_next_label=다음 +find_highlight=모두 강조 +find_match_case_label=대/소문자까지 정확히 +find_reached_top=문서의 처음, 끝에서부터 계속 +find_reached_bottom=문서의 끝, 처음에서부터 계속 +find_not_found=구절을 찾을 수 없습니다 + +# Error panel labels +error_more_info=더 보기 +error_less_info=간략히 +error_close=닫기 +# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be +# replaced by the PDF.JS version and build ID. +error_version_info=PDF.js v{{version}} (build: {{build}}) +# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an +# english string describing the error. +error_message=메시지: {{message}} +# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack +# trace. +error_stack=스택: {{stack}} +# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename +error_file=파일: {{file}} +# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number +error_line=행: {{line}} +rendering_error=쪽 렌더링 중 오류가 발생했습니다. + +# Predefined zoom values +page_scale_width=너비 맞춤 +page_scale_fit=쪽 맞춤 +page_scale_auto=자동 맞춤 +page_scale_actual=실제 크기 + +# Loading indicator messages +loading_error_indicator=오류 +loading_error=PDF를 불러오던 중 오류가 발생했습니다. +invalid_file_error=PDF 파일이 아니거나 깨진 파일입니다. +missing_file_error=PDF 파일이 없습니다. + +# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip. +# "{{type}}" will be replaced with an annotation type from a list defined in +# the PDF spec (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +text_annotation_type=[{{type}} Annotation] +request_password=암호로 보호되는 PDF파일입니다: + +printing_not_supported=경고: 이 브라우져는 출력을 완전히는 지원하지 않습니다. +printing_not_ready=경고: 이 PDF 파일은 완전히 적재되지 않았습니다. +web_fonts_disabled=웹 폰트 사용이 비활성되었습니다: 내장 PDF 폰트를 사용할 수 없습니다. +web_colors_disabled=웹 컬러가 비활성되었습니다. From f9e56497b83d91e7b87a5134de0798b9162af92b Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Mon, 29 Apr 2013 15:44:36 -0500 Subject: [PATCH 11/13] Removes es-MX locale (per #3088) --- l10n/es-MX/chrome.properties | 18 ------ l10n/es-MX/metadata.inc | 8 --- l10n/es-MX/viewer.properties | 121 ----------------------------------- 3 files changed, 147 deletions(-) delete mode 100644 l10n/es-MX/chrome.properties delete mode 100644 l10n/es-MX/metadata.inc delete mode 100644 l10n/es-MX/viewer.properties diff --git a/l10n/es-MX/chrome.properties b/l10n/es-MX/chrome.properties deleted file mode 100644 index 755920bf3..000000000 --- a/l10n/es-MX/chrome.properties +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2012 Mozilla Foundation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Chrome notification bar messages and buttons -unsupported_feature=Este documento PDF podría no mostrarse correctamente. -open_with_different_viewer=Abrir con un lector distinto -open_with_different_viewer.accessKey=o diff --git a/l10n/es-MX/metadata.inc b/l10n/es-MX/metadata.inc deleted file mode 100644 index 650c5d805..000000000 --- a/l10n/es-MX/metadata.inc +++ /dev/null @@ -1,8 +0,0 @@ - - - es-MX - PDF Viewer - Utiliza HTML5 para mostrar archivos PDF directamente en Firefox. - - - diff --git a/l10n/es-MX/viewer.properties b/l10n/es-MX/viewer.properties deleted file mode 100644 index e7aff0612..000000000 --- a/l10n/es-MX/viewer.properties +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright 2012 Mozilla Foundation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Main toolbar buttons (tooltips and alt text for images) -previous.title=Página anterior -previous_label=Anterior -next.title=Página siguiente -next_label=Siguiente - -# LOCALIZATION NOTE (page_label, page_of): -# These strings are concatenated to form the "Page: X of Y" string. -# Do not translate "{{pageCount}}", it will be substituted with a number -# representing the total number of pages. -page_label=Página: -page_of=of {{pageCount}} - -zoom_out.title=Reducir -zoom_out_label=Reducir -zoom_in.title=Aumentar -zoom_in_label=Aumentar -zoom.title=Tamaño -print.title=Imprimir -print_label=Imprimir -presentation_mode.title=Cambiar al modo de presentación -presentation_mode_label=Modo de presentación -open_file.title=Abrir archivo -open_file_label=Abrir -download.title=Descargar -download_label=Descargar -bookmark.title=Vista actual (copiar o abrir en una nueva ventana) -bookmark_label=Vista actual - -# Tooltips and alt text for side panel toolbar buttons -# (the _label strings are alt text for the buttons, the .title strings are -# tooltips) -toggle_sidebar.title=Activar barra lateral -toggle_sidebar_label=Activar barra lateral -outline.title=Mostrar el esquema del documento -outline_label=Esquema del documento -thumbs.title=Mostrar miniaturas -thumbs_label=Miniaturas -findbar.title=Buscar en el documento -findbar_label=Buscar - -# Thumbnails panel item (tooltip and alt text for images) -# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page -# number. -thumb_page_title=Página {{page}} -# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page -# number. -thumb_page_canvas=Miniatura o página {{page}} - -# Context menu -first_page.label=Ir a la primera página -last_page.label=Ir a la última página -page_rotate_cw.label=Girar hacia la derecha -page_rotate_ccw.label=Girar hacia la izquierda - -# Find panel button title and messages -find_label=Buscar: -find_previous.title=Ir a la anterior frase encontrada -find_previous_label=Anterior -find_next.title=Ir a la siguiente frase encontrada -find_next_label=Siguiente -find_highlight=Marcar todo -find_match_case_label=Coincidir con mayúsculas y minúsculas -find_reached_top=Inicio del documento, se continúa desde el final -find_reached_bottom=Final del documento, se continúa desde el inicio -find_not_found=No se encontró la frase - -# Error panel labels -error_more_info=Más información -error_less_info=Menos información -error_close=Cerrar -# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be -# replaced by the PDF.JS version and build ID. -error_version_info=PDF.js v{{version}} (compilación: {{build}}) -# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an -# english string describing the error. -error_message=Mensaje: {{message}} -# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack -# trace. -error_stack=Pila: {{stack}} -# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename -error_file=Archivo: {{file}} -# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number -error_line=Línea: {{line}} -rendering_error=Ocurrió un error al interpretar la página. - -# Predefined zoom values -page_scale_width=Ancho de página -page_scale_fit=Ajustar a la página -page_scale_auto=Ampliación automática -page_scale_actual=Tamaño real - -# Loading indicator messages -loading_error_indicator=Error -loading_error=Ocurrió un error al cargar el PDF. -invalid_file_error=Archivo PDF inválido o corrupto. -missing_file_error=Archivo PDF faltante. - -# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip. -# "{{type}}" will be replaced with an annotation type from a list defined in -# the PDF spec (32000-1:2008 Table 169 – Annotation types). -# Some common types are e.g.: "Check", "Text", "Comment", "Note" -text_annotation_type=[Anotación {{type}}] -request_password=El archivo PDF está protegido por contraseña: - -printing_not_supported=Advertencia: la impresión no está completamente soportada en este navegador. -web_fonts_disabled=Las tipografías web están deshabilitadas: no es posible utilizar tipografías PDF incrustadas. From 2c504120b88cdc4458fdc8d486145fc0274a30e9 Mon Sep 17 00:00:00 2001 From: vyv03354 Date: Tue, 30 Apr 2013 20:24:01 +0900 Subject: [PATCH 12/13] Fixes the unprefixed gradient declaration --- web/viewer.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/viewer.css b/web/viewer.css index 804cafb3e..da0896418 100644 --- a/web/viewer.css +++ b/web/viewer.css @@ -344,7 +344,7 @@ html[dir='rtl'] #sidebarContent { height: 100%; width: 50px; - background-image: linear-gradient(left, #999 0%, #fff 50%, #999 100%); + background-image: linear-gradient(to right, #999 0%, #fff 50%, #999 100%); background-size: 100% 100% no-repeat; -moz-animation: progressIndeterminate 2s linear infinite; From adf61ea5b0fcd04c7c310cd7000dc508c3a0efdb Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 30 Apr 2013 16:44:51 +0200 Subject: [PATCH 13/13] Make spacebar work on document load - fixes bug 864619 --- web/viewer.html | 4 ++-- web/viewer.js | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/web/viewer.html b/web/viewer.html index 76b158d81..7ec84f050 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -76,7 +76,7 @@ limitations under the License. - +
@@ -212,7 +212,7 @@ limitations under the License. data-l10n-id="page_rotate_cw" > -
+
diff --git a/web/viewer.js b/web/viewer.js index 225e95ac9..111e0c990 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -1442,6 +1442,13 @@ var PDFView = { left + ',' + top; } self.setInitialView(storedHash, scale); + + // Make all navigation keys work on document load, + // unless the viewer is embedded in another page. + if (window.parent === window) { + PDFView.container.focus(); + PDFView.container.blur(); + } }); pagesPromise.then(function() { @@ -1480,12 +1487,6 @@ var PDFView = { self.outline = new DocumentOutlineView(outline); document.getElementById('viewOutline').disabled = !outline; }); - - // Make all navigation keys work on document load, - // unless the viewer is embedded in another page. - if (window.parent.location === window.location) { - PDFView.container.focus(); - } }); pdfDocument.getMetadata().then(function(data) {