feat(fonts): getFontBuffer()#15182
Merged
florian-lefebvre merged 20 commits intomainfrom Jan 22, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 50eb0a2 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes |
sarah11918
approved these changes
Jan 21, 2026
Member
sarah11918
left a comment
There was a problem hiding this comment.
Beautiful changeset @florian-lefebvre ! 🙌
Co-authored-by: Sarah Rainsberger <[email protected]>
matthewp
reviewed
Jan 21, 2026
ematipico
approved these changes
Jan 21, 2026
Member
ematipico
left a comment
There was a problem hiding this comment.
Please make sure that the RFC is updated
Merged
dadezzz
pushed a commit
to dadezzz/ice-notes
that referenced
this pull request
Jan 26, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [astro](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/astro)) | [`5.16.12` → `5.16.13`](https://renovatebot.com/diffs/npm/astro/5.16.12/5.16.13) |  |  | --- ### Release Notes <details> <summary>withastro/astro (astro)</summary> ### [`v5.16.13`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#51613) [Compare Source](https://github.com/withastro/astro/compare/[email protected]@5.16.13) ##### Patch Changes - [#​15182](withastro/astro#15182) [`cb60ee1`](withastro/astro@cb60ee1) Thanks [@​florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a new `getFontBuffer()` method to retrieve font file buffers when using the experimental Fonts API The `getFontData()` helper function from `astro:assets` was introduced in 5.14.0 to provide access to font family data for use outside of Astro. One of the goals of this API was to be able to retrieve buffers using URLs. However, it turned out to be impactical and even impossible during prerendering. Astro now exports a new `getFontBuffer()` helper function from `astro:assets` to retrieve font file buffers from URL returned by `getFontData()`. For example, when using [satori](https://github.com/vercel/satori) to generate OpenGraph images: ```diff // src/pages/og.png.ts import type{ APIRoute } from "astro" -import { getFontData } from "astro:assets" +import { getFontData, getFontBuffer } from "astro:assets" import satori from "satori" export const GET: APIRoute = (context) => { const data = getFontData("--font-roboto") const svg = await satori( <div style={{ color: "black" }}>hello, world</div>, { width: 600, height: 400, fonts: [ { name: "Roboto", - data: await fetch(new URL(data[0].src[0].url, context.url.origin)).then(res => res.arrayBuffer()), + data: await getFontBuffer(data[0].src[0].url), weight: 400, style: "normal", }, ], }, ) // ... } ``` See the [experimental Fonts API documentation](https://docs.astro.build/en/reference/experimental-flags/fonts/#accessing-font-data-programmatically) for more information. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45Mi40IiwidXBkYXRlZEluVmVyIjoiNDIuOTIuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
getFontBuffer()function that get the buffer using a url from the result ofgetFontData()getFontData()is used, a js file is created per buffer in the server output in addition to actual files in the client output. Not sure there's much we can do about itTesting
Docs