Use custom fonts in your Google Docs template file and troubleshoot related issues, as described in the following sections:

Note: Some customers have reported problems when using custom fonts in templates. The PDF service sometimes fails to convert the HTML file to PDF correctly when custom fonts are present. The resulting PDF document may not display the text using the custom font. If you experience this problem, we recommend removing all custom fonts from your Google Docs template.

How custom fonts are displayed by AppSheet

When you use custom fonts like "Libre Barcode 128" and "Libre Barcode 39 Extended Text", the HTML file that is returned when AppSheet reads the Google Docs template includes an import url that refers to these custom fonts.

When your event fires, AppSheet does the following:

  1. Reads the Google Doc file in HTML format.

  2. Creates the attachment from the HTML template file.

  3. Converts the resulting attachment from HTML to PDF by calling the HTML-to-PDF web conversion service.

The HTML-to-PDF web conversion service relies on the HTML file containing the right import url value. The import url must refer to all of the custom fonts that you are using in your PDF attachment. If the import url is missing one or more of your custom fonts, the data values in the PDF attachment file are displayed in the default font rather than in the custom font. See Verifying all custom fonts are present.

Adding a custom font to a template

To add a custom font to a Google Docs template:

  1. Open your application in the AppSheet Editor.

  2. Go to the Automation > Tasks tab.

  3. Expand the appropriate task.

  4. Find the template property.

  5. Click View adjacent to the template name to open the template in Google Docs.

  6. From the Google Docs Font menu select More Fonts ...

  7. View the list of My fonts in the right pane of the dialog box.

  8. Use the Search box to find additional fonts that you want to add.
    For example, enter Libre Barcode in the Search box to display a list of related fonts. Fonts that you are using currently are displayed in blue text with a checkmark to their left. To add a font, click its name; the font display will change to blue text with a checkmark to its left.

  9. Click OK.

  10. Use the custom font in your template, as described below.

Using a custom font in a template

To use a custom font in an email template:

  1. Open your application in the AppSheet Editor.

  2. Go to the Automation > Tasks tab.

  3. Expand the appropriate task.

  4. Find the template property.

  5. Click View adjacent to the template name top open the template in Google Docs.

  6. Highlight the text in your template for which you want to apply the custom font.

  7. In the Google Docs Font menu select the custom font you wish to apply to the highlighted template element.

  8. Save your changes.

Detecting custom fonts using the audit history log

Determine whether a Google Docs attachment template contains a custom font by triggering the event and checking the audit history log.

Customize the dashboard settings and locate the appropriate audit record. For example, click the binoculars icon in the Details column and check the EmailAttachment property for the value AttachmentTemplateHasCustomFonts. This value will be true if the Google Docs attachment template contains custom fonts.

Note: You may need to wait for up to five minutes for the audit record to appear. AppSheet groups audit records before writing them to the audit history log to reduce overhead. This can result in a delay before an audit record appears in the audit history. If you don't see an audit record, click Search periodically to refresh the audit history log.

Verifying all custom fonts are present in the HTML

To verify that the HTML file returned by Google Doc contains the right custom fonts:

  1. Open your Google Docs template file in Google Docs.

  2. On the Google Docs File menu select Download > Web Page (.html zipped).

  3. Google Docs will export your Google Docs template file as a .zip file and display the zipped file name in a tab at the bottom of the browser.

  4. Click the ^ symbol to the right of the .zip file name in the tab at the bottom of the browser. Select Show in Finder.

  5. Unzip the .zip file to access your template in HTML format.

  6. Right click on the .html file, select Rename, and change the file extension from .html to .txt.

  7. Right click on the renamed template .txt file and select Edit.

  8. Near the top of the template file, look for @import url. It should look something like the following:
    @import url('https://themes.googleusercontent.com/fonts/css?kit=mJ_rGOyyL62_i4eysdBvxCC0kCcps6hmr3Uub3CurLj6HJltGXvViurXJL6xt9sxwzYVTjVaNNEx2pDT4aBU4J6Nc2zktOcTrnnZfLDyCt73rGVtsTkPsbDajuO5ueQw')

  9. Copy the url value starting from https: until just before the closing single quote, paste it into the address line of your browser, and press Enter.

  10. Content similar to the following is displayed.
    Make sure all of the custom fonts you are using are listed.

/* latin */
@font-face {
font-family: 'Libre Barcode 128';
font-style: normal;
font-weight: 400;
src: local('Libre Barcode 128 Regular'), local('LibreBarcode128-Regular'), url(https://fonts.gstatic.com/s/librebarcode128/v8/cIfnMbdUsUoiW3O_hVviCwVjuLtXeK_H9AI.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Libre Barcode 39 Extended Text';
font-style: normal;
font-weight: 400;
src: local('Libre Barcode 39 Extended Text'), local('LibreBarcode39ExtendedText-Regular'), url(https://fonts.gstatic.com/s/librebarcode39extendedtext/v7/eLG1P_rwIgOiDA7yrs9LoKaYRVLQ1YldrrOnnL7xPO4jNP6Me7gj.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Libre Barcode 39 Text';
font-style: normal;
font-weight: 400;
src: local('Libre Barcode 39 Text Regular'), local('LibreBarcode39Text-Regular'), url(https://fonts.gstatic.com/s/librebarcode39text/v8/sJoa3KhViNKANw_E3LwoDXvs5Un0HQ1vT-0H0h5K.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+

2212, U+2215, U+FEFF, U+FFFD;
}

Removing all custom fonts from your Google Docs template

If you experience issues, you may want to remove all custom fonts from your Google Docs template.

To remove all custom fonts from your Google Docs template:

  1. Open your application in the Editor.

  2. Go to the Automation > Tasks tab in the Editor.

  3. Expand the appropriate task.

  4. Find the template property.

  5. Click View adjacent to the template name. This will open the template in Google Docs.

  6. From the Google Docs Font menu, uncheck all custom fonts.

  7. Use the procedure described in Verifying all custom fonts are present to ensure that no custom fonts remain.

Did this answer your question?