Skip to content

[p5.js 2.0 Beta Bug Report]: Typr error: pako is not defined for some fonts #7707

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

Closed
1 of 17 tasks
davepagurek opened this issue Apr 7, 2025 · 1 comment
Closed
1 of 17 tasks

Comments

@davepagurek
Copy link
Contributor

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

Latest dev-2.0

Web browser and version

Firefox

Operating system

MacOS

Steps to reproduce this

Some woff fonts (not woff2, which we know isn't supported) aren't being read by Typr, and instead throw the error "pako is not defined". The actual error message is caught and silently handled, so you have to check "pause on caught exceptions" in your debugger to see it:

Image

Here's the woff file I'm testing on, which is the latin italic woff2 of Montserrat from here https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap and then converted manually to a woff: http://davepagurek.com/stuff/montserrat-italic.woff

Steps:

  1. Load the font with font = await loadFont('http://davepagurek.com/stuff/montserrat-italic.woff')

Snippet:

https://editor.p5js.org/davepagurek/sketches/AsxD8pcb0

@dhowe
Copy link
Contributor

dhowe commented Apr 7, 2025

I've added a comment on a previous issue in Typr. Note also that google at least determines font format from the user-agent. While probably not advisable, at least in the core, we could force specific compatible formats by spoofing this only for font requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants