Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load fonts in Web Worker #1286

Closed
av01d opened this issue Mar 20, 2024 · 1 comment · Fixed by #1322
Closed

Cannot load fonts in Web Worker #1286

av01d opened this issue Mar 20, 2024 · 1 comment · Fixed by #1322
Labels
documentation Changes only affect the documentation released This issue/pull request has been released.

Comments

@av01d
Copy link

av01d commented Mar 20, 2024

I am confused... was issue #289 ever considered? Using fonts in a WebWorker (still) does not work.
Example worker:

importScripts('./jimp.js');

(async () => {

  const font = await Jimp.loadFont('fonts/open-sans/open-sans-32-black/open-sans-32-black.fnt');

  self.addEventListener('message', e => {
    Jimp.read(e.data).then((img) => {
      img
      .print(font, 10, 10, "Hello World!")
      .getBase64(Jimp.AUTO, (err, src) => {
        if (err) throw err;
        self.postMessage(src);
      });
    });
  });

})();

The following error is thrown:

jimp.js:2 Uncaught (in promise) Error: error parsing font document is not defined

Using latest version of jimp (0.22.12)

Originally posted by @av01d in #289 (comment)

@hipstersmoothie hipstersmoothie added the documentation Changes only affect the documentation label Mar 28, 2024
@hipstersmoothie
Copy link
Collaborator

🚀 Issue was released in v1.1.5 🚀

@hipstersmoothie hipstersmoothie added the released This issue/pull request has been released. label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Changes only affect the documentation released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants