On this page:

To change the font for the whole document, you need to do the following:

  1. Specify the font in the HTML templates.
  2. Install the font on the operating system where the document-exporter service is deployed.
  3. If you want the font of the table of contents to be other than the default Arial font, specify it in the properties file.


Example of changing the document font to Noto Sans

Let’s assume you want to use the Google Noto Sans font as the main font of the document.


To change the default font to Noto Sans


  1. Change the font-family in the templates of the document-exporter:
    1. Open the <template_folder>/common/styles.html.
    2. Find the style tag with th:fragment="CommonStyles".
    3. Locate the body tag within and change the font-family value to "Noto Sans".
    4. Add a generic font family, e.g., sans-serif, to the end of the list so that an alternative font is selected if the main font is unavailable.

      <style th:fragment="CommonStyles">
         body {
                  font-family: "Noto Sans", sans-serif;
                  …
         }
      …
      </style>
  2. Install the font on the operating system where the document-exporter web application is deployed.
  3. Open the <web_app_platform_install_root>/shared/conf/webappplatform.properties file and set Noto Sans as the value of the fonts.toc.default property.

    export.fonts.toc.default=Noto Sans


Installing fonts

Some publicly available fonts have their own installation scripts and instructions. If this is the case, follow the official installation instructions.

Fonts must be embeddable. You can configure the export to avoid embedding for most of the fonts, but it is not recommended because all users who open the exported document need to have these fonts installed on their computers.


Example of installing the Noto Sans font

Let's say you need to install the Noto Sans font.


To install the Noto Sans font on Linux


  1. Download the Noto Sans font from the official Google Noto Fonts website.
  2. Extract the archive to a directory of your choice.
  3. Copy the extracted font files to the /usr/share/fonts/noto directory.
  4. Execute the following command to clean the font cache:

    fc-cache –fv
  5. Execute the following command to check if the new Noto sans font is installed:

    fc-list | grep –i noto


To install the Noto Sans font on Windows


  1. Download the Noto Sans font from the official Google Noto Fonts website.
  2. Extract the archive to a directory of your choice.
  3. Select and right-click the extracted font files, then select Install.
  4. Open the Windows fonts list to see if the Noto Sans font is installed.


Example of installing a custom/proprietary font

Let's assume you need to install a custom font, e.g., MyCompanyFont, available as a .tiff file, e.g., MyCompanyFont.tiff.

 

To install a custom font on Linux


  1. Copy the font file to the /usr/share/fonts/mycompany directory.
  2. Execute the following command to clean the font cache:

    fc-cache –fv
  3. Execute the following command to check if the MyCompanyFont font is installed:

    fc-list | grep MyCompanyFont


To install a custom font on Windows


  1. Right-click the MyCompanyFont.tiff file and select Install.
  2. Open the Windows fonts list to see if the MyCompanyFont font is installed.