Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

id1968159610

...

id1968159631

...

id1968174488

On this page

Table of Contents
maxLevel4

...

id1968159620

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

...

  1. the font-family

...

  1.  in the templates of the document-exporter:
    1. Open

...

    1. the <template_folder>/common/styles.html.
    2. Find

...

    1. the style

...

    1.  tag with th:fragment="CommonStyles".
    2. Locate

...

    1. the body

...

    1.  tag within and change

...

    1. the font-family

...

    1.  value to "Noto Sans".
    2. 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.

      Code Block
      <style th:fragment="CommonStyles">
         body {
                  font-family: "Noto Sans", sans-serif;
                  …
         }
      …
      </style>
  1. Install the font on the operating system where the document-exporter web application is deployed.
  2. Open

...

  1. the <web_app_platform_install_root>/shared/conf/webappplatform.properties

...

  1.  file and

...

  1. set Noto Sans

...

  1.  as the value of

...

  1. the fonts.toc.default

...

  1.  property.

    Code Block
    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.

Note
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

...

  1. the /usr/share/fonts/noto

...

  1.  directory.
  2. Execute the following command to clean the font cache:

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

    Code Block
    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

...

  1. select Install.
  2. 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

...

  1. the /usr/share/fonts/mycompany

...

  1.  directory.
  2. Execute the following command to clean the font cache:

    Code Block
    fc-cache –fv
  3. Execute the following command to check if

...

  1. the MyCompanyFont

...

  1.  font is installed:

    Code Block
    fc-list | grep MyCompanyFont


To install a custom font on Windows


  1. Right-click

...

  1. the MyCompanyFont.tiff

...

  1.  file and

...

  1. select Install.
  2. Open the Windows fonts list to see if

...

  1. the MyCompanyFont

...

  1.  font is installed.