I am using the following code:
I am using it at the top of my project here: Scale Test Cubes - CodeSandbox
import { FontLoader } from "three/examples/jsm/loaders/FontLoader.js";
const loader = new FontLoader();
var xLengthText;
const font = loader.load(
// resource URL
"https://threejs.org/examples/fonts/helvetiker_regular.typeface.json",
// onLoad callback
function (font) {
// do something with the font
xLengthText = new THREE.TextGeometry("Hello three.js!", {
font: font,
size: 5,
height: 5,
curveSegments: 12,
bevelEnabled: true,
bevelThickness: 10,
bevelSize: 8,
bevelOffset: 0,
bevelSegments: 5
});
},
// onProgress callback
function (xhr) {
console.log((xhr.loaded / xhr.total) * 100 + "% loaded");
},
// onError callback
function (err) {
console.log("An error happened");
}
);
And I get the error: