Capítulo 208 de 859
A loader for the TTF format.
Loads TTF files and converts them into typeface JSON that can be used directly to create THREE.Font objects.
const loader = new TTFLoader();
const json = await loader.loadAsync( 'fonts/ttf/kenpixel.ttf' );
const font = new Font( json );
Constructor
| Signature |
|---|
new TTFLoader( manager : LoadingManager ) |
Properties
| Property | Description |
|---|---|
.reversed : boolean | Whether the TTF commands should be reversed or not. |
Methods
| Method | Description |
|---|---|
.load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback ) | Starts loading from the given URL and passes the loaded TTF asset to the onLoad() callback. |
.parse( arraybuffer : ArrayBuffer ) : Object | Parses the given TTF data and returns a JSON for creating a font. |