Working with Fonts

The result of document recognition is dependent on the fonts used during processing and their settings. ABBYY FineReader Engine provides you with the options of using available fonts, but there are cases when you need to set the fonts manually:

  • you use an operating system with a limited set of fonts or without fonts (for example, any server version of Linux distribution without Graphical User Interface)
  • your document contains specific fonts (for example, non-Latin fonts)

In these cases, it is important to set the fonts before launching your application because several processing stages require the usage of the correctly tuned fonts:

  • PDF opening
  • Document synthesis
  • Export to PDF

This article contains useful information on how to set the fonts manually and describes ABBYY FineReader Engine functions designed for working with fonts.

PDF opening

PDF contains the information about which fonts were used to create it. This information is necessary for PDF rasterization, for example, to process the visible text from the picture and determine the fonts used and their parameters. To open the output PDF with the correctly displaying fonts, use one of the following methods:

  • copy the desired fonts manually into the Data/Resources/Font folder in the distribution package. This method does not register fonts in your operating system and affects only the PDF opening. By default, the fonts from this folder are not used during document synthesis and export.
  • copy the desired fonts manually into the /usr/share/fonts system folder. This method registers fonts in the operating system. The fonts from this folder will be used for document synthesis or export if you specify them in ISynthesisParamsForDocument::FontSet property (see Document synthesis and export to PDF section). By default, these fonts are used during synthesis only if they were embedded in input PDF (see description of the FNF_Auto filter in FontNamesFiltersEnum enumeration).
  • install the package for the installation of the fonts (use the ttf-mscorefonts-installer package in Debian-like systems and the msttcore-fonts-installer package in RHEL-like systems). This method performs the installation of the fonts automatically and uses the same peculiarities of setting the fonts for synthesis and export as the previous method.

Note: After copying the fonts into the system folder or installing them with the package in some operating systems, you need to update the font cache with the fc-cache -f command.

The required fonts to include:

  • Arial
  • Times New Roman
  • Courier New

Note: To detect the various styles of a single font in the text, we recommend including several basic font styles at once (regular, bold, and italic).

Document synthesis and export to PDF

When synthesizing the document or exporting it to PDF, ABBYY FineReader Engine selects the best font from the set of fonts specified in the ISynthesisParamsForDocument::FontSet property. By default, the number of fonts in this set is optimized for a balance between the speed of processing and the quality of output documents.

To set the fonts manually:

1. Choose any folder on your machine to be used as fonts storage.

2. Copy the files of the required fonts into this folder. The fonts recommended for document synthesis and export are listed in the FontNamesFiltersEnum enumeration.

3. Specify the folder with fonts using the Folder property of the CustomFontSet object.

Use the recommendations below in case you need to change the default font set:

  • You can use fonts from the PDF opening section not only to open PDF but also when synthesizing and exporting any input document. To do this, specify in the Folder property of the CustomFontSet object the path to the font folder that you previously chose in the PDF opening section.
  • You can use a predefined font filter for a particular language, e.g., FNF_Chinese, FNF_Japanese. Use the FontNamesFilter property of the SystemFontSet or CustomFontSet object.
  • You can specify particular font families used in your document in the FontNamesCustomFilter property of the SystemFontSet or CustomFontSet object.
  • You can specify the FNF_FineReader filter for the fonts in the FontNamesFilter property of the SystemFontSet or CustomFontSet object. This filter allows FineReader Engine to use more fonts during document synthesis and select better fonts as compared to the default mode. However, the speed of processing may slow down. This may be useful, for example, when converting to an editable format. Before specifying this filter, check the list of fonts it uses and make sure these fonts are present on your workstation.

See also

Working with Languages

Running ABBYY FineReader Engine 12 inside a Docker container

03.07.2024 8:50:25

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.