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

More typography updates #7434

Merged
merged 5 commits into from
Dec 20, 2024
Merged

More typography updates #7434

merged 5 commits into from
Dec 20, 2024

Conversation

davepagurek
Copy link
Contributor

@davepagurek davepagurek commented Dec 18, 2024

Changes

  • Adds back alpha in textToPoints using a getter to avoid upfront extra costs if it's not
    • Aliases it from an angle property, possibly more understandable?
  • Adds a convenience function for WebGL, font.textToModel(), to make an immediately renderable 3D model, using the same API as textToPoints
  • Let WebGL mode load from Google Fonts

Screenshots of the change:

image

PR Checklist

@davepagurek
Copy link
Contributor Author

davepagurek commented Dec 18, 2024

Looks like there's not a good way to force Google Fonts to serve ttfs unfortunately--it'll do it if you don't supply a user agent header, but we can't do that with fetch without breaking CORS and not being able to read the response.

So if we want to get Typr working on a google font, we'll probably have to decode the woff2 files, which would be a quite big dependency, which we probably also don't want. Alas. We'll see what the implementation of photopea/Typr.js#7 in Typr is, maybe if it's able to be loaded on-demand it could be ok?

@davepagurek davepagurek marked this pull request as ready for review December 18, 2024 19:44
@davepagurek davepagurek merged commit 83c6db9 into dev-2.0 Dec 20, 2024
2 checks passed
@davepagurek davepagurek deleted the more-typography-updates branch December 20, 2024 18:37
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