Commit Graph

8854 Commits

Author SHA1 Message Date
Jonas Jenwald
17aaa125df Keep track of the character to glyph mapping in font_renderer.js, to prevent errors when different characters point to the same glyph (issue 7101)
Fixes 7101.
2016-03-30 11:33:04 +02:00
Yury Delendik
bec4891f5d Merge pull request #7102 from brendandahl/onerror
Log uncaught global errors.
2016-03-29 17:23:28 -05:00
Tim van der Meij
6d2b195857 Merge pull request #7128 from Snuffleupagus/issue-6204-unittest
Add unit-tests for destionations in /Names (NameTree) dictionaries where all entries are indirect objects
2016-03-29 22:44:22 +02:00
Nico Schlömer
7cb055307d Add element to text layer even if width === 0
Some browsers render certain special characters with width 0, others with strictly positive width. (For example, the Greek Delta, Δ, has width 0 in Google Chrome, and a positive width in Firefox.) The `if` clause in operation so far results in different text layer DOM trees for different browsers.

This commit fixes that by adding the elements independently of their width.
2016-03-29 19:32:51 +02:00
Brendan Dahl
4e2f70440f Merge pull request #6711 from yurydelendik/errors
Better errors capturing at the core and stop rendering on error.
2016-03-29 09:19:28 -07:00
Jonas Jenwald
ac772017b6 Add unit-tests for destionations in /Names (NameTree) dictionaries where all entries are indirect objects
Re: issue 6204 and PR 6208.
2016-03-29 17:55:05 +02:00
Yury Delendik
df0cbccfd8 Merge pull request #7129 from yurydelendik/jasmine
Updates Jasmine version.
2016-03-29 10:32:17 -05:00
Yury Delendik
0a700fa29d Updates Jasmine version. 2016-03-29 09:34:13 -05:00
Tim van der Meij
553928c26e Merge pull request #7118 from Snuffleupagus/issue-7115
Prevent failures in the Annotation code if the `Rect` array contains indirect objects (issue 7115)
2016-03-29 00:04:59 +02:00
Yury Delendik
27dd386248 Merge pull request #7122 from Snuffleupagus/issue-7117
Allow unit-tests to use linked PDF files, by having the `unittest` command download unavailable ones (issue 7117)
2016-03-28 10:19:17 -05:00
Jonas Jenwald
8f097abb46 Allow unit-tests to use linked PDF files, by having the unittest command download unavailable ones (issue 7117) 2016-03-27 13:17:55 +02:00
Jonas Jenwald
13d7a5070e Prevent failures in the Annotation code if the Rect array contains indirect objects (issue 7115)
Note that in the PDF files provided by the reporter, this issue was limited to `Rect` arrays in AcroForm entries (which we currently don't support).
However, since a bad PDF generator could create this problem in *any* kind of annotation, the reduced test-case included here uses a simple LinkAnnotation instead.

Fixes 7115.
2016-03-26 20:55:16 +01:00
Brendan Dahl
df7afcf004 Merge pull request #7053 from yurydelendik/rm-pdfjs-core
Removes global PDFJS usage from the src/core/.
2016-03-25 13:19:43 -07:00
Yury Delendik
c22c85f8ee Merge pull request #7113 from yurydelendik/disable-issue6961
Disables issue6961 test.
2016-03-25 13:12:36 -05:00
Yury Delendik
a505aa8e90 Disables issue6961 test. 2016-03-25 12:48:11 -05:00
Jonas Jenwald
b589add2b5 Update l10n files 2016-03-25 14:10:56 +01:00
Brendan Dahl
7aa864db3e Merge pull request #7108 from yurydelendik/frontWindow-null
Removes frontWindow usage from the stream converter.
2016-03-24 10:24:13 -07:00
Yury Delendik
2b246192e1 Removes frontWindow usage from the stream converter. 2016-03-24 11:47:34 -05:00
Tim van der Meij
da8e345d14 Merge pull request #7005 from tobytailor/master
Fixes insertion of blank pages during print if page sizes differ
2016-03-24 14:38:27 +01:00
Yury Delendik
2fa4dd6f40 Proxy global PDFJS.verbosity to properly configure shared/util. 2016-03-23 19:24:37 -05:00
Yury Delendik
a8e5912cb1 Moves shared/global to display/global 2016-03-23 19:24:37 -05:00
Yury Delendik
e372f3608b Makes WorkerMessageHandler non-global. 2016-03-23 19:24:37 -05:00
Yury Delendik
bda5e6235e Removes global PDFJS usage from the src/core/. 2016-03-23 19:24:37 -05:00
Tim van der Meij
e1ac5744d0 Merge pull request #7105 from fkaelberer/fkaelberer-issue-template
Add an ISSUE_TEMPLATE
2016-03-23 22:59:45 +01:00
fkaelberer
4eb9daf34a Add an ISSUE_TEMPLATE 2016-03-23 22:48:14 +01:00
Brendan Dahl
fb47490648 Log uncaught global errors. 2016-03-22 15:49:32 -07:00
Yury Delendik
54ee15d866 Merge pull request #7100 from yurydelendik/stream-wo-parser
Removes core/stream circular dependency on core/parser.
2016-03-22 15:08:12 -05:00
Yury Delendik
4a44a2c7dc Merge pull request #7098 from Snuffleupagus/uint32-checksums
Ensure that TrueType font tables have `uint32` checksums
2016-03-22 14:11:27 -05:00
Yury Delendik
6038c236b2 Removes core/stream circular dependency on core/parser. 2016-03-22 14:06:01 -05:00
Jonas Jenwald
d78fae0181 Ensure that TrueType font tables have uint32 checksums
According to "The table directory" under https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6.html#Directory, TrueType font tables should have `uint32` checksums.

This is something that I noticed, and was initially confused about, while debugging a TrueType issue.
As far as I can tell, the current (`int32`) checksums we use doesn't cause any issues in practice. However, I do think that this should be addressed to agree with the specification, and to reduce possible confusion when reading the font code.
2016-03-22 13:40:50 +01:00
Tobias Schneider
708895ffba Let print canvas height scale proportionally 2016-03-21 14:21:07 -07:00
Tobias Schneider
aeabd0db20 Fix insertion of blank pages during printing due to non-matching page sizes 2016-03-21 14:21:07 -07:00
Yury Delendik
21ed8ff71d Merge pull request #7039 from prometheansacrifice/async-cmap-factory
Refactors CMapFactory.create to make it async
2016-03-21 13:57:36 -05:00
Manas
f6d28ca323 Refactors CMapFactory.create to make it async 2016-03-21 23:08:19 +05:30
Tim van der Meij
7ad8f3a6f0 Merge pull request #7093 from Snuffleupagus/gulp-importl10n-dir-fix
Use the correct path when checking if a `/l10n` directory exists, to avoid errors during `gulp importl10n` (PR 7063 followup)
2016-03-20 22:12:30 +01:00
Jonas Jenwald
41e5fa3c7a Use the correct path when checking if a /l10n directory exists, to avoid errors during gulp importl10n (PR 7063 followup)
This is regression from PR 7063, causing `gulp importl10n` to fail:
```
$ gulp importl10n
[19:45:02] Using gulpfile c:\Users\Jonas\Git\pdfjs\gulpfile.js
[19:45:02] Starting 'importl10n'...

Downloading ach...
[19:45:02] 'importl10n' errored after 4.42 ms
[19:45:02] Error: EEXIST, file already exists 'c:\Users\Jonas\Git\pdfjs\l10n\ach
'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:747:18)
    at downloadLanguageFiles (c:\Users\Jonas\Git\pdfjs\external\importL10n\local
es.js:59:8)
    at next (c:\Users\Jonas\Git\pdfjs\external\importL10n\locales.js:90:5)
    at Object.downloadL10n (c:\Users\Jonas\Git\pdfjs\external\importL10n\locales
.js:91:5)
    at Gulp.<anonymous> (c:\Users\Jonas\Git\pdfjs\gulpfile.js:92:11)
    at module.exports (c:\Users\Jonas\Git\pdfjs\node_modules\gulp\node_modules\o
rchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (c:\Users\Jonas\Git\pdfjs\node_modules\gulp\no
de_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (c:\Users\Jonas\Git\pdfjs\node_modules\gulp\no
de_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (c:\Users\Jonas\Git\pdfjs\node_modules\gulp\node_
modules\orchestrator\index.js:134:8)
```
2016-03-20 20:02:43 +01:00
Brendan Dahl
56f5c3a5ff Merge pull request #7088 from Snuffleupagus/issue-6957
Pass the `PDFJS.postMessageTransfer` parameter to the worker, so that the `MessageHandler` can be setup correctly in `createDocumentHandler` (issue 6957)
2016-03-18 13:08:46 -07:00
Jonas Jenwald
91756f6e86 Pass the PDFJS.postMessageTransfer parameter to the worker, so that the MessageHandler can be setup correctly in createDocumentHandler (issue 6957)
This regressed in commit acdd49f480, i.e. PR 6571.

Fixes 6957.
2016-03-16 18:34:26 +01:00
Jonas Jenwald
122d473239 Merge pull request #7084 from timvandermeij/gulp-fix
Revert renaming `node make` to `gulp` for `mozcentral`
2016-03-14 10:25:11 +01:00
Tim van der Meij
2b6d7ba3ec Gulp: allow passing parameters and revert one node make renaming 2016-03-13 21:53:17 +01:00
Yury Delendik
c6d2b7f9d9 Merge pull request #6906 from KamiHQ/fix-printing
avoid apply transform twice for composite context
2016-03-11 08:26:59 -06:00
Yury Delendik
8ba413e761 Better errors capturing at the core and stop rendering on error. 2016-03-11 07:59:09 -06:00
Jonas Jenwald
cd2bd057ab Refactor the building of toFontChar for non-embedded fonts
Currently there's a lot of duplicate code for non-embedded `toFontChar`, which this patch simplifies by extracting the code into a helper function instead.
2016-03-10 21:25:39 +01:00
Tim van der Meij
4784863ef7 Merge pull request #7069 from Snuffleupagus/TrueType-recover-glyphNames
Convert `uniXXXX` glyph names to proper ones when building the `charCodeToGlyphId` map for TrueType fonts (bug 1132849, issue 6893, issue 6894)
2016-03-10 20:45:59 +01:00
Jonas Jenwald
dfe9015a43 Convert uniXXXX glyph names to proper ones when building the charCodeToGlyphId map for TrueType fonts (bug 1132849, issue 6893, issue 6894)
This patch adds a `getUnicodeForGlyph` helper function, which is used to recover Unicode values for non-standard glyph names.

Some PDF generators, e.g. Scribus PDF, use improper `uniXXXX` glyph names which breaks the glyph mapping. We can avoid this by converting them to "standard" glyph names instead.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1132849.
Fixes 6893.
Fixes 6894.
2016-03-09 19:37:15 +01:00
Tim van der Meij
147598417c Merge pull request #7046 from a0preetham/zero_descent_fix
fonts.js: bad metric overrides when values are zero
2016-03-09 12:14:03 +01:00
Yury Delendik
4065a21f8c Merge pull request #7029 from Snuffleupagus/PDFThumnailView-refactor-canvas-to-image
[PDFThumbnailView] Re-factor the `canvas` to `image` conversion such that we always render to a `canvas`, and then replace it with an `image` once rendering is done
2016-03-07 14:00:39 -06:00
Yury Delendik
b540d7d6dc Merge pull request #7063 from timvandermeij/gulp
Migrate `clean` and `importl10n` target to gulp
2016-03-07 13:29:29 -06:00
Tim van der Meij
96cca2b37a Migrate clean and importl10n target to gulp 2016-03-04 21:14:56 +01:00
Tim van der Meij
b8aaa24257 Convert all node make instances to gulp 2016-03-04 20:30:36 +01:00