22353 Commits

Author SHA1 Message Date
Tim van der Meij
583c9d6b98
Update dependencies to the most recent versions
Note that the `globals` update rendered two ESLint ignore lines obsolete
because the `Sanitizer` global is now registered [1].

[1] 5d84602967
2026-04-12 16:16:21 +02:00
Tim van der Meij
006931f3d3
Merge pull request #21090 from calixteman/issue21089
Remove pattern fill when setting fill color before drawing a tile
2026-04-12 14:42:49 +02:00
Tim van der Meij
57acd97f6d
Merge pull request #21088 from Snuffleupagus/fonts-rm-int32-helper
Remove the `int32` helper, and replace it with `DataView` usage, in `src/core/fonts.js`
2026-04-12 14:25:14 +02:00
Tim van der Meij
01f5de36ad
Merge pull request #21087 from Snuffleupagus/Jbig2Image-DataView
Re-factor the `Jbig2Image` class, and related code, to use `DataView`s when reading data
2026-04-12 14:23:34 +02:00
Tim van der Meij
fbed36db00
Merge pull request #21082 from calixteman/fix_comb_ltr
Fix how the text is printed/saved in a comb field when it's a RTL one
2026-04-12 14:16:42 +02:00
Tim van der Meij
1a1e5dc296
Merge pull request #21083 from mozilla/dependabot/npm_and_yarn/basic-ftp-5.2.2
Bump basic-ftp from 5.2.1 to 5.2.2
2026-04-12 14:12:38 +02:00
calixteman
6d3034d4f9
Remove pattern fill when setting fill color before drawing a tile
It fixes #21089.
2026-04-12 13:08:45 +02:00
Jonas Jenwald
f924526f1a Remove the int32 helper, and replace it with DataView usage, in src/core/fonts.js
This helper function only had a single call-site, and it's easily replaced with a `DataView` method.
Additionally, to hopefully make future re-factoring easier, create a `DataView` for each TrueType table.
2026-04-12 10:01:14 +02:00
Jonas Jenwald
5089cceec7
Merge pull request #21086 from Snuffleupagus/JpegImage-DataView
Re-factor the `JpegImage` class, and related code, to use `DataView`s when reading data
2026-04-11 17:34:39 +02:00
Jonas Jenwald
afbded8da1 Re-factor the Jbig2Image class, and related code, to use DataViews when reading data 2026-04-11 16:44:15 +02:00
Jonas Jenwald
64e5a7021d Re-factor the JpegImage class, and related code, to use DataViews when reading data 2026-04-11 12:44:30 +02:00
dependabot[bot]
ec827e0766
Bump basic-ftp from 5.2.1 to 5.2.2
Bumps [basic-ftp](https://github.com/patrickjuchli/basic-ftp) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/patrickjuchli/basic-ftp/releases)
- [Changelog](https://github.com/patrickjuchli/basic-ftp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/patrickjuchli/basic-ftp/compare/v5.2.1...v5.2.2)

---
updated-dependencies:
- dependency-name: basic-ftp
  dependency-version: 5.2.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-10 22:09:53 +00:00
Calixte Denizet
fa9b2ae32c Fix how the text is printed/saved in a comb field when it's a RTL one 2026-04-10 22:48:18 +02:00
Jonas Jenwald
81c9a34fd3
Merge pull request #21079 from Snuffleupagus/CFFParser-DataView
Re-factor the `CFFParser` class to use `DataView`s when reading data
2026-04-10 19:56:46 +02:00
calixteman
7cfcafbb4b
Merge pull request #21069 from calixteman/issue21068
Take into account the alignment when printing/saving a comb field
2026-04-10 19:29:20 +02:00
Jonas Jenwald
dd9ed2040e Re-factor the CFFParser class to use DataViews when reading data 2026-04-10 17:44:19 +02:00
Jonas Jenwald
545b512e74
Merge pull request #21076 from Snuffleupagus/OpenTypeFileBuilder-DataView
Re-factor the `OpenTypeFileBuilder` class to use a `DataView` when writing data
2026-04-10 16:22:19 +02:00
Jonas Jenwald
cb3f956a11
Merge pull request #21073 from Snuffleupagus/TrueType-table-comments
Move some TrueType header comments to the correct lines
2026-04-10 15:08:24 +02:00
Jonas Jenwald
e9eabf051d Re-factor the OpenTypeFileBuilder class to use a DataView when writing data
Also, changes the `tables` field to a private `Map`.
2026-04-10 14:59:52 +02:00
calixteman
ca13d0089b
Merge pull request #21074 from mozilla/update-locales
l10n: Update locale files
2026-04-10 09:55:22 +02:00
github-actions[bot]
142f42559e l10n: Update locale files 2026-04-10 00:35:52 +00:00
Jonas Jenwald
a69b9ad033 Ensure that the built "hmtx" font table has valid widths (PR 21072 follow-up)
With the changes in PR 21072 the `string16` helper is no longer being used when building the "hmtx" table, which accidentally removed the development mode assert.
2026-04-09 23:15:02 +02:00
Jonas Jenwald
94f8934d05 Move some TrueType header comments to the correct lines
This is most likely fallout from the introduction of Prettier.
2026-04-09 22:55:38 +02:00
Tim van der Meij
ab124db046
Merge pull request #21072 from Snuffleupagus/hmtx-TypedArray
Use a TypedArray when building the "hmtx" font table
2026-04-09 21:26:45 +02:00
Tim van der Meij
27e171ea38
Merge pull request #21067 from mozilla/dependabot/npm_and_yarn/basic-ftp-5.2.1
Bump basic-ftp from 5.2.0 to 5.2.1
2026-04-09 21:23:36 +02:00
Jonas Jenwald
8f56ee2ae9 Use a TypedArray when building the "hmtx" font table
In this case it's trivial to compute the size of the data upfront, hence we can use a TypedArray which should be more efficient than a string.
2026-04-09 18:58:58 +02:00
calixteman
9efd9fa2c7
Merge pull request #21071 from Snuffleupagus/BBOX_INIT
Add constants for defining the initial BBox and Float32 BBox
2026-04-09 14:51:56 +02:00
calixteman
b5f52c49d0
Merge pull request #21070 from Snuffleupagus/ChunkedStream-getBytes-non-length-update-pos
Update the position when calling `ChunkedStream.prototype.getBytes` without a length
2026-04-09 14:00:52 +02:00
calixteman
1d48f17b98
Merge pull request #21065 from calixteman/issue19988
Dont revoke blob URLs while printing but do it after
2026-04-09 13:50:34 +02:00
Calixte Denizet
3d544294af Take into account the alignment when printing/saving a comb field
It fixes #21068.
2026-04-09 13:48:20 +02:00
Jonas Jenwald
2d8b25cd6d Update the position when calling ChunkedStream.prototype.getBytes without a length
Currently the code only updates the position when the length is defined, and it seems that this has "always" been wrong. Originally I believe that the `ChunkedStream` class was essentially a copy of the `Stream` class, and that implementation had the same problem until PR 20593.

Hopefully there's no code that relies on the current incorrect behaviour[1], since testing every aspect of the `ChunkedStream` implementation can be tricky given that these things are timing dependant.

---

[1] If there are, fixing those call-sites may be as easy calling `ChunkedStream.prototype.reset`.
2026-04-09 12:15:19 +02:00
dependabot[bot]
81644a7ee9
Bump basic-ftp from 5.2.0 to 5.2.1
Bumps [basic-ftp](https://github.com/patrickjuchli/basic-ftp) from 5.2.0 to 5.2.1.
- [Release notes](https://github.com/patrickjuchli/basic-ftp/releases)
- [Changelog](https://github.com/patrickjuchli/basic-ftp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/patrickjuchli/basic-ftp/compare/v5.2.0...v5.2.1)

---
updated-dependencies:
- dependency-name: basic-ftp
  dependency-version: 5.2.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-08 20:13:58 +00:00
Jonas Jenwald
0fd556f435 Take full advantage of the lookupRect helper in the FunctionBasedShading constructor 2026-04-08 20:30:20 +02:00
Jonas Jenwald
654985c621 Add constants for defining the initial BBox and Float32 BBox
Nowadays there's a lot of places in the code-base where we need to initialize or reset bounding boxes. Rather than spelling this out repeatedly, this patch adds new `Array`/`Float32Array` constants that can be copied or used as-is where appropriate.
2026-04-08 20:30:20 +02:00
Calixte Denizet
ea15ac31ef Dont revoke blob URLs while printing but do it after
It fixes #19988.

In Firefox, when printing, the document is cloned and use an image cache
which isn't available when there's a service worker.
2026-04-08 14:04:09 +02:00
Jonas Jenwald
a67b952118
Merge pull request #21062 from Snuffleupagus/compileIndex-TypedArray
Reduce allocations in `CFFCompiler.prototype.compileIndex` (PR 21053 follow-up)
2026-04-07 21:47:39 +02:00
calixteman
59c21e3110
Merge pull request #21061 from calixteman/pattern_perf
Avoid as much as possible to have intermediate canvases
2026-04-07 21:07:45 +02:00
Calixte Denizet
00ea8db6bf
Avoid as much as possible to have intermediate canvases
We try to detect in the worker if some patterns or groups need to be drawn or not in isolation.
When they don't, we just draw them on the main canvas instead of drawing on a new canvas.
A pattern or a group is considered as being in isolation if it has some compositing rules or some transparency.

It improves the rendering performance of the pdf in bug 1731514.
2026-04-07 21:03:43 +02:00
Tim van der Meij
70baf9cd5f
Merge pull request #21057 from mozilla/dependabot/github_actions/codecov/codecov-action-6.0.0
Bump codecov/codecov-action from 5.5.2 to 6.0.0
2026-04-07 20:41:50 +02:00
Tim van der Meij
36f63bebcc
Merge pull request #21058 from mozilla/dependabot/github_actions/actions/deploy-pages-5.0.0
Bump actions/deploy-pages from 4.0.5 to 5.0.0
2026-04-07 20:41:32 +02:00
Tim van der Meij
1f2e4adfc5
Merge pull request #21050 from Snuffleupagus/Ascii85Stream-fill
Replace a couple of loops with `TypedArray.prototype.fill()` in the `src/core/ascii_85_stream.js` file
2026-04-07 20:38:27 +02:00
Tim van der Meij
60668707fb
Merge pull request #21056 from mozilla/dependabot/github_actions/github/codeql-action-4.35.1
Bump github/codeql-action from 4.33.0 to 4.35.1
2026-04-07 20:34:12 +02:00
Jonas Jenwald
7b1b1a9153 Reduce allocations in CFFCompiler.prototype.compileIndex (PR 21053 follow-up)
It's possible to compute the final index-data size upfront, thus avoiding a bunch of intermediate allocations during index compilation.
This also means that a TypedArray can be used, rather than a plain Array, making it more efficient to insert the `objects` data.

This helps PDFs with large and complex CFF fonts the most, for example the PDFs in https://bugs.ghostscript.com/show_bug.cgi?id=706451 render ~40 percent faster (based on quick measurements in the viewer with `#pdfBug=Stats`).
2026-04-07 18:38:10 +02:00
calixteman
d6afffe8f6
Merge pull request #21059 from calixteman/bug2028193
Make sure the thumbnails positions are recomputed after a structural change but after a reflow has been done (bug 2028193)
2026-04-07 17:02:07 +02:00
calixteman
f61e00f2fa
Merge pull request #21054 from calixteman/fix_writing_numbers
Fix the way to write numbers when saving a pdf
2026-04-07 16:55:36 +02:00
calixteman
1bf1ef2939
Merge pull request #21053 from Snuffleupagus/CFFCompiler-TypedArray
Reduce allocations when compiling CFF fonts
2026-04-07 16:55:02 +02:00
Calixte Denizet
1b2e98f3ce
Make sure the thumbnails positions are recomputed after a structural change but after a reflow has been done (bug 2028193) 2026-04-07 15:48:23 +02:00
Jonas Jenwald
6f0431456c Reduce allocations when compiling CFF fonts
Currently the `CFFCompiler.prototype.compile` implementation seem a bit inefficient, since the data is stored in a plain Array that needs to grow (a lot) during compilation. Additionally, adding a lot of entries isn't very efficient either and requires special handling of the "too many elements" case.
Some of the "helper" methods that use TypedArrays internally currently need to convert their return data to plain Arrays, via the `compileTypedArray` method, which adds even more intermediate allocations.
Note also that the `OpenTypeFileBuilder` has a special-case for writing plain Array data, which is only needed because of how the CFF compilation is implemented.

To improve this situation the `CFFCompiler.prototype.compile` method is re-factored to store its data in a TypedArray, whose initial size is estimated from the "raw" file size.
This removes the need for most intermediate allocations, and it also handles adding of "many elements" more efficiently.
2026-04-07 14:27:55 +02:00
dependabot[bot]
147ce2b2d2
Bump actions/deploy-pages from 4.0.5 to 5.0.0
Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 4.0.5 to 5.0.0.
- [Release notes](https://github.com/actions/deploy-pages/releases)
- [Commits](d6db90164a...cd2ce8fcbc)

---
updated-dependencies:
- dependency-name: actions/deploy-pages
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-07 12:13:42 +00:00
dependabot[bot]
d936f9775b
Bump codecov/codecov-action from 5.5.2 to 6.0.0
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.5.2 to 6.0.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](671740ac38...57e3a136b7)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-07 12:13:24 +00:00