angular-threejs / angular-three

Angular Renderer for THREE.js
MIT License
213 stars 30 forks source link

About 3DText #61

Open yywf77 opened 3 weeks ago

yywf77 commented 3 weeks ago

Hi nartc! I found that local loading is normal when using 3DText today, but it takes about 3 minutes for remote loading to appear after the project is published. Is there any way to improve the speed of remote loading

      <ngts-center >
        <ngts-float>
          <ngts-text-3d [text]="title()" [font]="font()" [options]="options()">
            <ngt-mesh-normal-material />
          </ngts-text-3d>
        </ngts-float>
    </ngts-center>
nartc commented 3 weeks ago

Is the font dynamic or static? If statically known, you can try preloading it with injectFont.preload() outside of Angular components (or in main). Like:


injectFont.preload(() => '/path/to/font')

@Component()
export class MyCmp {}