-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Text3D
with already loaded font
#1050
Comments
i think the easiest/fastest would be if you add it https://github.com/pmndrs/drei/blob/master/src/core/Text3D.tsx |
Text3D already supports FontData input. FontLoader.load results in a FontData object right? I’m not sure where your |
@FarazzShaikh The problem with the current interface is that it doesn't fit well with the interface of const font = useFont('/fonts/helvetiker_regular.typeface.json')
return <Text3D font={font} /> To summarise why:
@wbobeirne probably tried to follow the example, which didn't work, hence the suggestion. As a workaround, you could do: const font = useFont('/fonts/helvetiker_regular.typeface.json')
const fontData = font.data
return <Text3D font={fontData} /> But I would agree that it should be possible to pass a |
Describe the feature you'd like:
I've already loaded a font using
FontLoader
, and I'd like to re-use it rather than fetching it again. However,Text3D
doesn't have a way to pass the already loaded font, only a string URL.Suggested implementation:
Either a new prop on
Text3D
, or extend thefont: string | FontData
prop to befont: string | FontData | Font
Sorry if I'm incorrect about something or just not using this properly!
The text was updated successfully, but these errors were encountered: