On this page:
To change the font for the whole document, you need to do the following:
- Specify the font in the HTML templates.
- Install the font on the operating system where the document-exporter service is deployed.
- 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
- Change the font-family in the templates of the document-exporter:
- Open the <template_folder>/common/styles.html.
- Find the style tag with th:fragment="CommonStyles".
- Locate the body tag within and change the font-family value to "Noto Sans".
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>
- Install the font on the operating system where the document-exporter web application is deployed.
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.
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
- Download the Noto Sans font from the official Google Noto Fonts website.
- Extract the archive to a directory of your choice.
- Copy the extracted font files to the /usr/share/fonts/noto directory.
Execute the following command to clean the font cache:
fc-cache –fv
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
- Download the Noto Sans font from the official Google Noto Fonts website.
- Extract the archive to a directory of your choice.
- Select and right-click the extracted font files, then select Install.
- 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
- Copy the font file to the /usr/share/fonts/mycompany directory.
Execute the following command to clean the font cache:
fc-cache –fv
Execute the following command to check if the MyCompanyFont font is installed:
fc-list | grep MyCompanyFont
To install a custom font on Windows
- Right-click the MyCompanyFont.tiff file and select Install.
- Open the Windows fonts list to see if the MyCompanyFont font is installed.