My goal is to generate 20 text blocks, all using the same font. However, I encountered an error with the new TextGeometry if the font isn't loaded yet.
Currently, I have been creating each text block like so:
new THREE.TextGeometry(this.text, {
font: Object(response) as THREE.Font
} as THREE.TextGeometryParameters);
within this block of code:
let fontLoader = new THREE.FontLoader();
fontLoader.load('/fonts/my_font.json', response => {
This approach is not efficient since it requires loading the font 20 times (once for each new text block), causing delays during execution, especially when testing.
I would prefer to load the font only once and save it in a variable, but I don't know how to ensure that it's fully loaded before generating the TextGeometry.
I'm wondering if Observables could help with this issue?
Your insights and suggestions would be greatly appreciated!