Skip to content

docs(editor,scripting): data binding fonts - #841

Open
lancesnider wants to merge 10 commits into
mainfrom
data-binding-fonts
Open

docs(editor,scripting): data binding fonts#841
lancesnider wants to merge 10 commits into
mainfrom
data-binding-fonts

Conversation

@lancesnider

@lancesnider lancesnider commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@lancesnider
lancesnider requested a review from a team as a code owner August 6, 2026 03:30
@mintlify

mintlify Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
rive 🟢 Ready View Preview Aug 6, 2026, 3:32 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and getBlob in 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.

Comment thread editor/data-binding/property-types.mdx Outdated
Comment thread editor/data-binding/property-types.mdx Outdated
@lancesnider
lancesnider removed the request for review from jeffatrive August 6, 2026 17:16
@lancesnider
lancesnider marked this pull request as draft August 6, 2026 17:16
@lancesnider
lancesnider marked this pull request as ready for review August 6, 2026 17:18
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the rive namespace (e.g. rive.decodeImage). As written, decodeFont is likely undefined in this snippet. Use rive.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",

@lancesnider
lancesnider requested a review from HayesGordon August 6, 2026 21:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 uses rive.* APIs), and it never unref()s the decoded font after assigning it. This will fail unless decodeFont is 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, loadFont is called before it is defined (it’s a const, so it’s not hoisted). This would throw at runtime, and the relative URL Orbitron.ttf is also likely to resolve incorrectly on nested routes.
  useEffect(() => {
    if (setHeadingFont) {
      loadFont("Orbitron.ttf");
    }
  }, [setHeadingFont]);

@zplata zplata left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small version fixes but lgtm!

dataBindingFonts: {
title: "Data Binding Fonts",
runtimes: {
webCanvas: { supported: true, version: "20.39.2+" },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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+" },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
webWebGL2: { supported: true, version: "20.39.2+" },
webWebGL2: { supported: true, version: "2.39.2+" },

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.

3 participants