Demos
Documentation
API
More Samples
Download Wijmo

Using a custom font

This sample shows how custom fonts can be embedded into a document.

In this sample, the Fira font family is used and two fonts, FiraSans-Regular.ttf and FiraSans-Bold.ttf, are embedded into the document. The FiraSans-Bold.ttf font is used to display the header cells, while the FiraSans-Regular.ttf font is used for rest of the content.

To achieve this, the following export settings are used:

  • embeddedFonts: Provides information to the export library, about custom fonts to be embedded, such as URL, name, style, weight.
  • styles: It is used to set up the style for the grid cells and link them with the embedded fonts during export.