Capítulo 167 de 859

Chapter 167: FontLoader

Core Idea

A loader for loading fonts.

You can convert fonts online using facetype.js.

Code Examples

const loader = new FontLoader();
const font = await loader.loadAsync( 'fonts/helvetiker_regular.typeface.json' );
  • What it demonstrates: Typical usage of FontLoader.

Reference Tables

Constructor

Signature
new FontLoader( manager : LoadingManager )

Methods

MethodDescription
.load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback )Starts loading from the given URL and passes the loaded font to the onLoad() callback.
.parse( json : Object ) : FontParses the given font data and returns the resulting font.

Key Takeaways

  1. FontLoader extends: Loader
  2. Key methods: load, parse.

Connects To