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

fix: Fix variable fonts in WebGL mode #7459

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AritraDey-Dev
Copy link

@AritraDey-Dev AritraDey-Dev commented Jan 6, 2025

Fixes #7447

Update FontInfo class in src/webgl/text.js to account for variable font changes and cache by variable value.

  • Add variableFontCache to FontInfo class to store variable font data.
  • Modify getGlyphInfo method to use cache key based on glyph index and variable values.
  • Adjust getGlyphInfo method to return cached glyph info based on cache key.
  • Update initialization of glyph info to use cache key.

For more details, open the Copilot Workspace session.

Fixes processing#7447

Update `FontInfo` class in `src/webgl/text.js` to account for variable font changes and cache by variable value.

* Add `variableFontCache` to `FontInfo` class to store variable font data.
* Modify `getGlyphInfo` method to use cache key based on glyph index and variable values.
* Adjust `getGlyphInfo` method to return cached glyph info based on cache key.
* Update initialization of glyph info to use cache key.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/processing/p5.js/issues/7447?shareId=XXXX-XXXX-XXXX-XXXX).
Copy link

welcome bot commented Jan 6, 2025

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!

@AritraDey-Dev
Copy link
Author

Please verify my pr and let me know if any change is required

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.

[2.0] Make variable Typr p5.Fonts use the same variables as the 2D canvas
1 participant