Commit Graph

17298 Commits

Author SHA1 Message Date
Jonas Jenwald
b51bbdf055 Update l10n files 2023-05-28 09:44:15 +02:00
Jonas Jenwald
0e129c9e5e Update npm packages 2023-05-28 09:39:34 +02:00
Jonas Jenwald
6d8810b55c
Merge pull request #16479 from Snuffleupagus/PDFFindController-onIsPageVisible
Re-factor the `isPageVisible`-handling in the find-controller (PR 10217 follow-up)
2023-05-26 15:25:55 +02:00
Jonas Jenwald
d0bf505312 Re-factor the isPageVisible-handling in the find-controller (PR 10217 follow-up)
The way that this was implemented in PR 10217 has always bothered me slightly, since the `isPageVisible`-method that I introduced there always felt quite out-of-place in the `IPDFLinkService`-implementations.
Hence this is instead replaced by a callback-function in `PDFFindController`, to handle the page-visibility checks. Note that since the `PDFViewer`-constructor always sets this callback-function, e.g. the viewer-component examples still work as-is.
2023-05-26 13:59:39 +02:00
calixteman
cbc4b20b12
Merge pull request #16474 from calixteman/issue16473
Reset the formatted value when after a text field has been modified
2023-05-26 10:43:40 +02:00
Calixte Denizet
be5db13005 Reset the formatted value when after a text field has been modified 2023-05-26 10:17:14 +02:00
Jonas Jenwald
2bf68f3c7f
Merge pull request #16472 from calixteman/issue16471
Extract all the text of text annotations
2023-05-26 09:33:48 +02:00
Calixte Denizet
35a58ed987 Extract all the text of text annotations 2023-05-25 23:11:42 +02:00
Jonas Jenwald
2890c464da
Merge pull request #16466 from Snuffleupagus/gv-rm-Toolbar-stub
[GeckoView] Remove the `Toolbar`-stub since the viewer has an actual toolbar now
2023-05-25 22:23:10 +02:00
calixteman
8d5da54cd5
Merge pull request #16467 from calixteman/non_null_ultimate
Avoid to have a null fallback if none has been provided
2023-05-24 17:00:14 +02:00
Jonas Jenwald
ba654343e1
Merge pull request #16451 from Snuffleupagus/Wingdings
Attempt to improve non-embedded Wingdings font support (bug 1652224)
2023-05-24 16:04:12 +02:00
Jonas Jenwald
5a7beb9f30 Attempt to improve non-embedded Wingdings font support (bug 1652224)
Now that font-substitution has been implemented, we should be able to do much a better job at supporting non-embedded Wingdings fonts.
Given that this is a Windows-specific font, see https://en.wikipedia.org/wiki/Wingdings, this is however not guaranteed to work (well) on other platforms.
2023-05-24 14:59:13 +02:00
Calixte Denizet
7dce0a27f6 Avoid to have a null fallback if none has been provided 2023-05-24 14:44:36 +02:00
Jonas Jenwald
76ca395c32 [GeckoView] Remove the Toolbar-stub since the viewer has an actual toolbar now 2023-05-24 12:31:27 +02:00
Jonas Jenwald
daa48e5305
Merge pull request #16465 from Snuffleupagus/issue-16464
Ignore named encoding for non-embedded symbol fonts (issue 16464)
2023-05-24 11:56:59 +02:00
Jonas Jenwald
aeed6f2b67 Ignore named encoding for non-embedded symbol fonts (issue 16464)
The affected font is non-embedded ZapfDingbats, however the PDF document for some inexplicable reason specifies the encoding as "WinAnsiEncoding" (which is obviously wrong).
To work-around this bug in the PDF generator, we'll simply ignore any explicitly specified named encoding for non-embedded symbol fonts.
2023-05-24 10:48:47 +02:00
Jonas Jenwald
a6f9505a39
Merge pull request #16461 from Snuffleupagus/issue-16454
Improve "EI" detection in inline images (PR 12028 follow-up, issue 16454)
2023-05-23 22:23:22 +02:00
calixteman
1886012874
Merge pull request #16462 from calixteman/last_elem_TJ
Take into account the final space if any in the TJ command
2023-05-23 21:26:58 +02:00
calixteman
7cfe00a190
Merge pull request #16445 from calixteman/smoothing
[Editor] Improve curve smoothing for Ink tool (bug 1789443)
2023-05-23 19:20:24 +02:00
Calixte Denizet
d2b4ed3cea [Editor] Improve curve smoothing for Ink tool (bug 1789443)
- Remove the dependency on fit-curve;
- Improve the way to draw the current line in using a Path2D and
  in clearing only the last part of the curve instead of clearing
  all the canvas;
- Smooth the curve when drawing to avoid to have some changes after
  the drawing ends;
- Make the smoothing a bit less agressive.
2023-05-23 17:15:21 +02:00
Calixte Denizet
a76a69e1ed Take into account the final space if any in the TJ command
The final space was just ignored and that led to wrongly position
the next chunk of text.
2023-05-23 17:09:32 +02:00
Jonas Jenwald
dfbbb8c0ac Improve "EI" detection in inline images (PR 12028 follow-up, issue 16454)
Given that inline images may contain "EI"-sequences in the image-data itself, actually finding the end-of-image operator isn't always straightforward.
Here we extend the implementation from PR 12028 to potentially check all of the following bytes, rather than stopping immediately. While we have fairly decent test-coverage for this code, whenever you're changing it there's unfortunately a slightly higher than normal risk of regressions. (You'd really wish that PDF generators just stop using inline images.)
2023-05-23 17:04:51 +02:00
calixteman
094fb3c783
Merge pull request #16453 from calixteman/gv_telemetry
[GeckoView] Add some telemetry for the toolbar buttons (bug 1829216)
2023-05-22 17:08:43 +02:00
Calixte Denizet
7f1e8d1920 [GeckoView] Add some telemetry for the toolbar buttons (bug 1829216) 2023-05-22 16:43:09 +02:00
calixteman
1c4e4b4092
Merge pull request #16450 from calixteman/issue16300
Sanitize the glyph bounding box
2023-05-21 17:40:36 +02:00
Calixte Denizet
ca12bca276 Sanitize the glyph bounding box
- if the contours count is lower than -1, the glyph is really likely wrong
so just remove it from the font;
- if a contour has the repeat flag then repeats count mustn't be 0.
2023-05-21 16:24:41 +02:00
Tim van der Meij
d09c27d231
Merge pull request #16449 from Snuffleupagus/attachments-viewer-rm-sort
Stop trying to sort the attachments in the sidebar
2023-05-21 12:25:28 +02:00
Jonas Jenwald
14fd59c4d0 Stop trying to sort the attachments in the sidebar
Looking at the behaviour in Adobe Reader it doesn't appear that attachments are sorted alphabetically, hence it doesn't seem necessary for us to do so either in the viewer.
An additional benefit of *not* sorting the attachments is that any "actual" attachments are now always placed at the top of the list in the sidebar, and if any `FileAttachment`-annotations exist in the document they will now be appended at the end.
2023-05-21 09:54:24 +02:00
calixteman
65e23432cd
Merge pull request #16448 from calixteman/improve_rescaleandstroke
Improve performance of canvas::rescaleAndStroke by around 30% (bug 1135277)
2023-05-20 21:06:40 +02:00
Calixte Denizet
e5454be0f2 Improve performance of canvas::rescaleAndStroke by around 30%
The pdf linked in bug 1135277 contains a lot of stroke instructions.
In using the Firefox profiler, this patch helps to reduce the overall
spent time in this function by 30%.
2023-05-20 18:21:25 +02:00
Tim van der Meij
1d74936ea9
Merge pull request #16446 from Snuffleupagus/bug-1365930
Extend `getNonStdFontMap` for non-embedded Impact fonts (bug 1365930)
2023-05-20 12:20:52 +02:00
Jonas Jenwald
f657de7de2 Extend getNonStdFontMap for non-embedded Impact fonts (bug 1365930)
According to https://en.wikipedia.org/wiki/Impact_(typeface) this font should be available on all current versions of Windows, and with the recently added font-substitution we should actually be able to render it correctly (at least on Windows).
2023-05-19 18:40:03 +02:00
Tim van der Meij
38287d9435
Merge pull request #16443 from Snuffleupagus/idFactory-shorter
[api-minor] Slightly shorten some `idFactory` strings
2023-05-19 11:36:06 +02:00
Jonas Jenwald
8c4821ceda [api-minor] Slightly shorten the marked-content ids used in the textLayer
Generally we try to keep the ids that we create short, hence we can slightly shorten the "static" parts of them.
2023-05-18 22:32:10 +02:00
Jonas Jenwald
04de155aaa Slightly shorten the loadedName-ids used with font-substitutions
Generally we try to keep the ids that we create short, hence we can slightly shorten the "static" part of them.
2023-05-18 22:27:11 +02:00
Jonas Jenwald
3be66f59d6
Merge pull request #16440 from Snuffleupagus/more-modern-JS
Introduce even more modern JavaScript features in the code-base
2023-05-18 20:56:00 +02:00
calixteman
e8537e4d30
Merge pull request #16439 from calixteman/issue14755
Flush the current chunk when the font changed because of a restore op (issue #14755)
2023-05-18 20:10:31 +02:00
Calixte Denizet
3091e70aad Flush the current chunk when the font changed because of a restore op (issue #14755) 2023-05-18 19:37:16 +02:00
Jonas Jenwald
e8030752f3 Introduce even more modern JavaScript features in the code-base
After PR 12563 we're now free to use e.g. logical OR assignment, nullish coalescing, and optional chaining in the entire code-base.
2023-05-18 18:55:41 +02:00
calixteman
a24d5b629e
Merge pull request #16438 from mozilla/loc_note_openinapp
Add a localization note to explain that 'Open in app' strings are for mobile (bug 1833858)
2023-05-18 17:27:39 +02:00
Marco Castelluccio
77f8fd91ec Add a localization note to explain that 'Open in app' strings are for mobile (bug 1833858) 2023-05-18 16:43:12 +02:00
Jonas Jenwald
356f3cf285
Merge pull request #16437 from Snuffleupagus/loadFont-simpler-fontID
Simplify the `fontID` handling in `PartialEvaluator.loadFont`
2023-05-18 13:36:00 +02:00
Jonas Jenwald
4355e76c60 Simplify the fontID handling in PartialEvaluator.loadFont
The `fontID` handling is quite old and predates the use of the `idFactory` to generate a unique id for each font, hence we can simplify this code a little bit.
2023-05-18 13:09:08 +02:00
Tim van der Meij
ac8032628b
Merge pull request #16424 from Snuffleupagus/core-optional-chaining
Introduce more optional chaining in the `src/core/` folder
2023-05-18 12:40:08 +02:00
calixteman
839be801a0
Merge pull request #16433 from calixteman/bug1825002
For text widgets, get the text from the AP stream instead of from the format callback (bug 1825002)
2023-05-17 16:48:59 +02:00
Calixte Denizet
177036e6ae For text widgets, get the text from the AP stream instead of from the format callback (bug 1825002)
When fixing bug 1766987, I thought the field formatted value came from
the result of the format callback: I was wrong. The format callback is ran
but the value is unused (maybe it's useful to set some global vars... or
it's just a bug in Acrobat). Anyway the value to display is the one rendered
in the AP stream.
The field value setter has been simplified and that fixes issue #16409.
2023-05-17 14:07:28 +02:00
Jonas Jenwald
46bbabbd5d
Merge pull request #16434 from Snuffleupagus/issue-16432
Attempt to fallback to a default font, for non-available ones, in more cases (issue 16432)
2023-05-17 12:30:08 +02:00
Jonas Jenwald
bfb374dbf6 Attempt to fallback to a default font, for non-available ones, in more cases (issue 16432)
This essentially extends PR 11218 to also apply when looking up the final font-reference, via the XRef-table, fails because the font isn't available.

This patch also changes `PartialEvaluator.fallbackFontDict` to simply use "Helvetica" as the default font-name, since that seems generally reasonable given the now existing font-substitution code.
2023-05-17 11:41:08 +02:00
calixteman
5ae353cf4d
Merge pull request #16431 from calixteman/warn_missing_os_font
Warn when pdf.js can't load an OS font
2023-05-16 15:25:16 +02:00
Calixte Denizet
385f275ad9 Warn when pdf.js can't load an OS font 2023-05-16 14:58:38 +02:00