Skip to content

troika-three-text: Expose font loading errors, prevent Text sync status getting stuck - #399

Merged
lojjic merged 1 commit into
protectwise:mainfrom
uramer-cozmos:fix-398-font-load-failure
Nov 25, 2026
Merged

lojjic merged 1 commit into
protectwise:mainfrom
uramer-cozmos:fix-398-font-load-failure

Conversation

@uramer-cozmos

Copy link
Copy Markdown
Contributor

Fixes #398 and #328

We use troika text for a website constructor, and need a way to react to text rendering errors programmatically.
For example, a user can select fonts in the constructor's interface, and if a sync never resolves, text gets "stuck" in its current state.

Having an error callback would let us reset the text and fall back to the last valid font elegantly. The only ways to achieve that currently is to add an arbitrary timeout to the code waiting on Text.sync callback, or overriding console.error, which are both fragile.

@lojjic

lojjic commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Looks good to me, thank you!

@lojjic
lojjic merged commit 23db758 into protectwise:main Nov 25, 2026
1 check passed
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.

A font that fails to load leaves every text that needs it waiting forever

2 participants