drei icon indicating copy to clipboard operation
drei copied to clipboard

Use `Text3D` with already loaded font

Open wbobeirne opened this issue 3 years ago • 3 comments

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 the font: string | FontData prop to be font: string | FontData | Font

Sorry if I'm incorrect about something or just not using this properly!

wbobeirne avatar Sep 13 '22 16:09 wbobeirne

i think the easiest/fastest would be if you add it https://github.com/pmndrs/drei/blob/master/src/core/Text3D.tsx

drcmda avatar Sep 21 '22 22:09 drcmda

Text3D already supports FontData input. FontLoader.load results in a FontData object right? I’m not sure where your Font type comes from

FarazzShaikh avatar Oct 29 '22 08:10 FarazzShaikh