Add Custom Fonts

Edit in →

Theme Editor in SurveyJS Form Builder enables designers to personalize surveys and forms by creating custom UI themes. Although Theme Editor ships with a set of default fonts, you might want to use custom branded fonts to enhance the look and feel of your forms and give your surveys a personalized touch. To add custom fonts to Theme Editor, follow these steps:

  1. Register custom fonts.
    Add custom fonts to the page with Survey Creator. In this demo, custom fonts are loaded from a server and added as a <style> element to the <head> of the page. Refer to the loadFont function for code listing. The following code shows how you can specify custom TTF fonts using CSS:

    @font-face {
      font-family: "RobotoMono-Regular"; /* Provide a name for your font */
      src: url("./custom-fonts/RobotoMono-Regular.ttf") format("truetype");
      /* Add other font properties, like `font-weight` and `font-style` if needed */
    }
    @font-face {
      font-family: "RobotoMono-Italic"; /* Provide a name for your font */
      src: url("./custom-fonts/RobotoMono-Italic.ttf") format("truetype");
      /* Add other font properties, like `font-weight` and `font-style` if needed */
    }
    
  2. Add custom fonts to the font list.
    Import the DefaultFonts array from the "survey-creator-core" module and push new font names to this array. The font names must begin with a font's font-family attribute value:

    import { DefaultFonts } from "survey-creator-core";
    
    DefaultFonts.push(
        "RobotoMono-Regular, monospace",
        "RobotoMono-Italic, monospace"
    );
    

Now, custom fonts are available within Theme Editor. For instance, you can apply them using the Font Family setting in the Appearance tab:

Access Custom Fonts in SurveyJS Theme Editor

Your cookie settings

We use cookies on our site to make your browsing experience more convenient and personal. In some cases, they are essential to making the site work properly. By clicking "Accept All", you consent to the use of all cookies in accordance with our Terms of Use & Privacy Statement. However, you may visit "Cookie settings" to provide a controlled consent.

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.