troisjs / trois

✨ ThreeJS + VueJS 3 + ViteJS ⚡
https://troisjs.github.io
MIT License
4.19k stars 299 forks source link

Is <Text> broken ? #158

Closed Zebnastien closed 2 years ago

Zebnastien commented 2 years ago

Hello everyone,

I can't get "Text" to work.

So I tried to copy/past code from demo 3 on TroisJS website : https://troisjs.github.io/examples/demos/3.html I used the font file provided from github.

Result : no text, only particles.

Messages in the console when trying to use "Text" : Warn : THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead" Error : "Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')"

Am I the only one in that case ?

Zebnastien commented 2 years ago

I found the solution :

I went to /node_modules/three/examples/fonts/ and grabbed the font file from here. I can't explain why, but it works !

I hope this could help.