Skip to content

Commit

Permalink
When a font loading fails, invoke the callback to return. The object …
Browse files Browse the repository at this point in the history
…returned will have a function to indicate there's no glyphs so it'll render with the default font
  • Loading branch information
FranCarrascosaMS committed Apr 25, 2024
1 parent 0e18aa3 commit 892bb35
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/troika-three-text/src/FontResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function createFontResolver(fontParser, unicodeFontResolverClient) {
function doLoadFont(url, callback) {
const onError = err => {
console.error(`Failure loading font ${url}`, err)
callback({ supportsCodePoint: () => null })
}
try {
const request = new XMLHttpRequest()
Expand Down

0 comments on commit 892bb35

Please sign in to comment.