Skip to content

Fix loading fonts in web-worker#1322

Merged
hipstersmoothie merged 2 commits intomainfrom
browser-fonts
Sep 2, 2024
Merged

Fix loading fonts in web-worker#1322
hipstersmoothie merged 2 commits intomainfrom
browser-fonts

Conversation

@hipstersmoothie
Copy link
Collaborator

@hipstersmoothie hipstersmoothie commented Sep 2, 2024

closes #1286
closes #602 (by documenting how to use in worker)

Comment on lines +87 to +90
if (isWebWorker && typeof bufferOrUrl === "string") {
const res = await fetch(bufferOrUrl);
const text = await res.text();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The library we use to parse font docs doesn't support workers. This should work in most ends

@hipstersmoothie hipstersmoothie merged commit 6047422 into main Sep 2, 2024
@hipstersmoothie hipstersmoothie deleted the browser-fonts branch September 2, 2024 22:28
@hipstersmoothie
Copy link
Collaborator Author

🚀 PR 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

released This issue/pull request has been released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot load fonts in Web Worker Create @jimp/web-worker

1 participant