I'm looking to incorporate 3D text into my website using the following code (reference: Labelling the vertices in AxisHelper of THREE.js):
var textGeo = new THREE.TextGeometry('Test', {
size: 10,
height: 5,
curveSegments: 6,
font: "helvetiker",
style: "normal"});
var color = new THREE.Color();
color.setRGB(255, 250, 250);
var textMaterial = new THREE.MeshBasicMaterial({ color: color });
var text = new THREE.Mesh(textGeo , textMaterial);
scene.add(text);
To achieve this, it's necessary to include the font file helvetiker_regular.typeface.js before utilizing the text Geometry as Three.js relies on it for text geometry loading.
I've come across a json file named "helvetiker_regular.typeface.json" (https://github.com/mrdoob/three.js/tree/master/examples/fonts).
As a beginner in JS programming, I'm unsure how to properly include it to ensure my code functions correctly. Can someone provide guidance on this?