# Custom Fonts

DsPdf is a Document Solutions product that offers a rich library to read, create, modify, and save PDF files without using any external tool.

## Content

Sometimes you need custom fonts to use your creativity to create or edit a PDF document, which is not possible with the default fonts. With DsPdfViewer, you can add and use a list of new or custom fonts using **registerFont** method and **editorDefaults.fontNames** option.

Refer to the following example code to register and add custom fonts to DsPdfViewer:

```javascript
// Register custom fonts.
viewer.registerFont("BudmoJiggler-Regular", "/assets/budmo_jiggler.ttf");
viewer.registerFont("FantaisieArtistique", "/assets/FantaisieArtistique.ttf");
// Set editor defaults for free text annotation.
viewer.options.editorDefaults.freeTextAnnotation = { fontName: 'FantaisieArtistique', borderStyle: { width: 0 } };
// Add font names.
viewer.options.editorDefaults.fontNames = [
    { name: 'Disco font', value: 'BudmoJiggler-Regular' },
    { name: 'Fantaisie font', value: 'FantaisieArtistique' }
];
```

![](https://cdn.mescius.io/document-site-files/images/884d2bfb-301b-49bc-8d90-656c5b910507/images/custom-fonts.png)