Custom Fonts

Bonsai allows you to define and use custom fonts. You will usually want to include the font in several formats to support various browsers.

See MyFonts’ Browser Support Overview for more details on browser support.

Applying a custom font:

new FontFamily('myFontFamily', [

new Text('Just testing my font').attr({
  x: 50,
  fontSize: 40,

For more information on loading various assets please see the Assets overview