All examples · Text and UI

Vector fonts

What this example shows

useLoadFont reads a plain .ttf or .woff, with its kerning, accents and ñ, and keeps each letter as a distance field the first time it is shown. So the same font is sharp at any fontSize, scaled, turned, and through a camera zooming from 1x to 3x.

On a vector font fontSize is the size of the font as in CSS: one em, 16 when left out. A pixel font drawn as outlines keeps its square corners, and a material on a vector text works as on a sprite.

Fonts: Bangers and Press Start 2P, under the SIL Open Font License.

Starting