/FontGL

Renders fonts into WebGL.

Primary LanguageJavaScript

FontGL

Renders fonts into WebGL context.

Features

  • Font Face loading
  • GL Text rendering
  • Font atlas

Usage

FontFace

Loads a WebFont for use with an application.

Example

var face = new FontFace('family', 'url("http://src.url/font.woff") format("woff")');
face.load()
  .then(success, error);

Font

Creates a texture for rendering font to GL.

Example

var font = new Font('family', {gl : glContext});
font.ready.then(success, error);

Text

Renders a string to GL.

var text = new Text('message', font, gl);
text.render(perspectiveMatrix, modelViewMatrix);

Resources