Skip to content

Fix incorrect text weight for variable fonts in Safari #7738

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

Merged
merged 2 commits into from
Apr 15, 2025

Conversation

davepagurek
Copy link
Contributor

Resolves #7736

Changes

  • No longer sets canvas.style.fontVariationSettings with the font weight in Safari, as it seems to cache this value incorrectly when setting and resetting this value multiple times per frame
  • Updates the isSafari check because the old one was returning false on modern Safari

Screenshots of the change

This is what this sketch https://editor.p5js.org/davepagurek/sketches/iHyp1r92r looks like in Safari now for me, matching Chrome/Firefox:
https://github.com/user-attachments/assets/b40f2f4c-445e-4c0b-bbc0-16125fd70ed4

PR Checklist

@davepagurek davepagurek merged commit 48b8b15 into dev-2.0 Apr 15, 2025
2 checks passed
@davepagurek davepagurek deleted the fix/variable-font-safari branch April 15, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant