docs(editor,scripting): data binding fonts - #841
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
Pull request overview
Adds documentation coverage for Font-related data binding by updating the Editor’s View Model Property types page and expanding the Scripting data binding guide to include newly documented ViewModel accessors.
Changes:
- Added Font as a documented View Model Property type in the Editor data binding “Property Types” page (with an embedded demo video).
- Updated the Scripting data binding guide to include
getImage,getFont, andgetBlobin the list of ViewModel property accessors.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripting/data-binding.mdx | Adds links for additional ViewModel accessor APIs relevant to data binding (image/font/blob). |
| editor/data-binding/property-types.mdx | Documents the new Font property type and adds a video embed demonstrating font data binding. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (3)
runtimes/web/fonts.mdx:18
- There is a stray lone backtick (
) between the "For more information" paragraph and the` embed, which will render incorrectly (or potentially break formatting). Remove the extraneous backtick line.
For more information, see [Loading Assets](/runtimes/web/loading-assets).
`
<fallbackFonts />
runtimes/web/data-binding.mdx:365
- This example calls
decodeFont(...)directly, but the surrounding text and other examples on this page use therivenamespace (e.g.rive.decodeImage). As written,decodeFontis likely undefined in this snippet. Userive.decodeFont(...)here (or add an explicit import and update the prose).
const res = await fetch("/Orbitron.ttf");
const font = await decodeFont(new Uint8Array(await res.arrayBuffer()));
headingFontProperty.value = font;
snippets/demos.jsx:67
- Grammar: "Swap an font at runtime." should use "a" (and reads more naturally as "Swap a font at runtime.").
description:
'Swap an font at runtime.',
image: "https://static.rive.app/docs/data-binding-fonts.png",
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated no new comments.
Suppressed comments (4)
runtimes/web/fonts.mdx:18
- There is a stray standalone backtick (`) between the “Loading Assets” link and the snippet, which is likely to break MDX rendering.
For more information, see [Loading Assets](/runtimes/web/loading-assets).
`
<fallbackFonts />
runtimes/web/data-binding.mdx:365
- This example calls
decodeFont(...)without qualifying it (the rest of the page usesrive.*APIs), and it neverunref()s the decoded font after assigning it. This will fail unlessdecodeFontis in scope and may leak memory.
const res = await fetch("/Orbitron.ttf");
const font = await decodeFont(new Uint8Array(await res.arrayBuffer()));
headingFontProperty.value = font;
}
snippets/demos.jsx:67
- Grammar: “Swap an font at runtime.” should be “Swap a font at runtime.”
description:
'Swap an font at runtime.',
runtimes/react/data-binding.mdx:449
- In this snippet,
loadFontis called before it is defined (it’s aconst, so it’s not hoisted). This would throw at runtime, and the relative URLOrbitron.ttfis also likely to resolve incorrectly on nested routes.
useEffect(() => {
if (setHeadingFont) {
loadFont("Orbitron.ttf");
}
}, [setHeadingFont]);
zplata
left a comment
There was a problem hiding this comment.
Some small version fixes but lgtm!
| dataBindingFonts: { | ||
| title: "Data Binding Fonts", | ||
| runtimes: { | ||
| webCanvas: { supported: true, version: "20.39.2+" }, |
There was a problem hiding this comment.
| webCanvas: { supported: true, version: "20.39.2+" }, | |
| webCanvas: { supported: true, version: "2.39.2+" }, |
| webCanvas: { supported: true, version: "20.39.2+" }, | ||
| webCanvasLite: { supported: false, description: "NA" }, | ||
| webWebGL: { supported: false, description: "Not supported" }, | ||
| webWebGL2: { supported: true, version: "20.39.2+" }, |
There was a problem hiding this comment.
| webWebGL2: { supported: true, version: "20.39.2+" }, | |
| webWebGL2: { supported: true, version: "2.39.2+" }, |
No description provided.