Text3D を使う前に、このメソッドでフォントを初期化してください。
Text3D
フォントは TTF ファイルを TypeFace.js(https://gero3.github.io/facetype.js/)で変換した JSON ファイルを使います。 日本語フォントのようにファイルが大きくなる場合は、JSON を ZIP 圧縮したファイル(.json.zip)も使用できます。 (例: abcdefg.json → zip abcdefg.json.zip abcdefg.json)
.json.zip
abcdefg.json
zip abcdefg.json.zip abcdefg.json
フォントファイルのパス(.json または .json.zip)
.json
await initFont('fonts/helvetiker_regular.typeface.json');const text = new Text3D('Hello!');scene.add(text); Copy
await initFont('fonts/helvetiker_regular.typeface.json');const text = new Text3D('Hello!');scene.add(text);
Text3Dを使う前に、このメソッドでフォントを初期化してください。フォントは TTF ファイルを TypeFace.js(https://gero3.github.io/facetype.js/)で変換した JSON ファイルを使います。 日本語フォントのようにファイルが大きくなる場合は、JSON を ZIP 圧縮したファイル(
.json.zip)も使用できます。 (例:abcdefg.json→zip abcdefg.json.zip abcdefg.json)