Skip to main content
Gainsight Inc.

Set Up Google Fonts

This article explains how admins can configure and use Google Fonts in engagements using the HTML code. 

Overview

You can use Custom fonts to customize your engagement texts to give them the same look and feel as your application. You need to import custom font CSS rules to specify font families from various websites. 

Example Business Use Case: You can import Google Fonts into your engagement to enhance it’s look and style. 

Use Custom Fonts in Engagements

Custom fonts from Google can easily be imported and applied to various parts of PX engagements.

Import Google Fonts

You must have basic knowledge of HTML and CSS to import and apply custom fonts.

To import a Google custom font in your engagement: 

  1. Navigate to fonts.google.com
  2. In the Fonts tab, select a font style. 
  3. Click Select this style.
  4. Click on the View selected families icon. The Selected Families drawer is displayed. 
  5. From the Selected Family drawer, copy the link to embed the font into the <head> of your HTML. 
  6. Click on the Code View icon in the Editor tab of your Engagement Editor.  
  7. Embed the code into the <head> of your HTML. 
  8. Click Save.

Apply Imported Custom Fonts

To apply the imported custom fonts in the Old Editor: 

  1. From the Selected Family drawer, copy the value of the font family key value pair.
  2. In the CSS tab of the Editor, embed the font family for Dialog Wrapper, Dialog Title, Dialog Content and Dialog Main List.

Notes: 

  • You can embed different family fonts for different CSS content sections. 
  • Dialog Wrapper font is set as the default font if the font family is not defined for Dialog Title, Dialog Content and Dialog Main List.
  • Arial font is set as the default font if the font family is not defined for Dialog Wrapper.
  • Use the CSS keyword !important; to prioritize your custom CSS commands.

To apply the imported custom fonts in the New Editor: 

  1. From the Selected Family drawer, copy the value of the font family key value pair. In the CSS tab of the Editor, embed the font family for Dialog Wrapper, Dialog Title, Dialog Content and Dialog Main List.
  2. In the HTML tab of the editor, change the font type.

Change Font in Editor V2.jpg

Use Google Fonts in Survey Engagements

In addition to dialog and slider engagements, custom Google fonts can also be used in survey engagements across PX. For this, you need to import the required font into PX and then use the font family at the required instances. 

To import custom fonts for surveys: 

  1. Visit fonts.google.com.
  2. Search or select the desired font. 
  3. Click the Get font button.
  4. Click the Get embed code button.
  5. From the Web tab, select the @import option and copy the code.
  6. In PX, navigate to the Editor tab of the engagement.
  7. Select the title of the step, and click the Code View button.
  8. Paste the import code copied from Google font before the title.
  9. Click the Code View button to exit the HTML editor.
  10. (Optional) If you have multiple steps in the engagement, paste the import code in the title code view of all steps.

To apply the custom font:

  1. Navigate to the CSS tab. 
  2. Click Survey.
  3. Scroll down to the bottom of the code, and paste the following:
    Note: Replace the font family value with the name of the font you imported.
.px-dialog-title,
.px-dialog-content,
.fr-wrapper,
.step-wrapper,
.step-wrapper,
.apt-survey-step {
  font-family: "<REPLACE WITH FONT NAME>" !important;
}

Note: If a section is not displaying the imported font, ensure that the specific element’s class is included in the CSS code. For this, inspect the element using the browser’s dev tools, and copy the class name. Add the class name to the CSS code. For instance, if the name of the class is checkbox-component, add .checkbox-component, to the start of the code. 

  • Was this article helpful?