-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(fonts): getFontBuffer() #13041
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
base: main
Are you sure you want to change the base?
feat(fonts): getFontBuffer() #13041
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
|
||
| ### `getFontData()` | ||
| <p> | ||
| The [`getFontBuffer()`](#getfontbuffer) function can then be used on retrieved URLs to get font buffers, for example, in an [API Route](/en/guides/endpoints/#server-endpoints-api-routes) to generate OpenGraph images using [satori](https://github.com/vercel/satori), combined with proper [formats](#formats) configuration: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to mention formats when introducing this new option but forgot. Basically satori does not support woff2 so to use Astro fonts with it, you basically always need to set formats. I thought quickly mentioning here would be good
| <p> | ||
|
|
||
| **Type:** `(url: string) => Promise<Buffer>`<br /> | ||
| <Since v="5.16.11" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% sure what the version will be
Description (required)
Related issues & labels (optional)
For Astro version:
5.16.x. See astro PR #15182.