Skip to main content
Version: 10.0

Fonts

The conversion ("Converter“ web service) of foreign formats and the use of PDF/A conversion ("Pdfa“ web service) requires fonts so that the conversion can be carried out as accurately as possible.

The "Toolbox" web service needs fonts as well: its text watermark, its header/footer and its free text annotation are drawn with a font, and a request that names none is answered with the default font described under "Default font" below.

The "Signature" web service needs fonts for the text of visible signatures. It has its own font directories and its own default font; see text and font of the visible appearance.

The "OCR" and the "Barcode" web service need fonts as well: when they render a page, they draw annotations and form fields without an appearance (see appearance of annotations and form fields), and a character that the font of such an annotation does not have is drawn with a font of their own font directories. They have their own font directories and their own default font; see "Fonts of the OCR and Barcode web services" below.

caution

All the following information about the fonts and options refers exclusively to the integrated document converter and not to the Office-Bridge.

The server first looks for the font which has been used in the source document. If this font is not installed on the server, an attempt is made to find a substitute font. In doing so, the server tries to find a font which corresponds to the "font family" (typeface) of the original font or which is similar in appearance (e.g. with or without serifs). If no font is found, the conversion falls back to the default font of the system (see "Default font" below). For the fonts Arial, Helvetica, Times New Roman, Courier New and Calibri, a font of the same metrics is tried first (see "Substitute fonts" below). A Word document can also name alternate fonts for a font itself; the first one that is installed is used before that (see font resolution of the Word Converter).

caution

Whenever the original font of the document is not available and a substitute font must be used, there may be visual and content discrepancies between the original document and the created PDF document.

It is also important that the fonts support the corresponding unicode ranges. For example, if a document with Asian characters is converted, then there must be at least one font on the server which supports this unicode range.

caution

If possible, install the fonts on the server that are used in the documents you want to convert. This is the only way to achieve optimal conversion quality.

Replacement takes place automatically so that as nearly as possible, every document can be converted. If this should prove not to be possible, the operation, for example, a PDF/A conversion, will be cancelled and a corresponding error report is returned.

Supported formats​

The "Converter" web service presently supports TrueType Fonts (TTF) and TrueType Collections (TTC). In addition to TTF and TTC, the "Pdfa" web service also supports OpenType Fonts (OTF).

Variable fonts​

A variable font is a single file that holds several cuts of a family. The server reads the named instances such a file defines - for example Light, Regular, Medium, SemiBold and Bold - and offers each of them as a separate cut. A document that asks for one of them is converted with a font program generated for exactly that cut, not with the file's default cut and not with a substitute font.

A named instance is only offered if the font file provides a readable name for it. An instance without one is skipped and the remaining cuts of the same file are still used. The server names the affected file in the log in that case, because the family then offers fewer cuts than the file defines and a document asking for a missing cut falls back to another one.

note

Variable font instancing applies to TrueType-flavored variable fonts (TTF). A variable OpenType font (OTF, CFF2 outlines) and a named instance inside a TrueType Collection (TTC) are not instanced; both continue to embed the file's default cut, the way every variable font was handled before instancing existed.

If the cut a document asks for cannot be generated - for example because the font file is malformed in a way the initial scan did not detect - the conversion falls back to the file's default cut, exactly as it did before instancing existed. This fallback happens per request and is silent at the default log level; only debug mode records which file and which cut could not be generated.

caution

Generating the requested cut is the server's standard behavior and has no configuration switch or opt-out. A document that previously received a variable font's default cut for a request such as Bold - with the requested weight simulated on top of it - now receives the font file's actual Bold cut instead, and its appearance changes accordingly. There is no way to restore the earlier behavior other than running an earlier release. One correction reaches beyond variable fonts: a static font file whose name states both a weight between Regular and Bold and an italic style - for example SemiBold Italic or Medium Italic - is now reported as italic instead of upright. Such text previously received the converter's simulated slant on top of a font that was already slanted, and was therefore rendered doubly slanted; it now uses the font's own slant alone.

Diagnosing font problems​

A font file that cannot be processed is skipped: the scan continues with the next file and the web service starts normally. This applies to every web service that reads fonts ("Converter", "Pdfa" and "Toolbox").

The support report of the server lists the fonts of the "OCR", "Barcode" and "Signature" web services as well.

caution

A single unusual or damaged font file in a scanned directory therefore no longer prevents a web service from starting. Do not rely on a failing service as an indication that a font is unusable - the log is the place to look.

Two log levels help to narrow a font problem down:

  • At the default level the server reports a font file it could not read at all, and a file whose variable cuts could not be used completely. Both messages name the file.
  • In debug mode every font file is written to the log before it is read. This identifies a file that causes trouble without producing a message of its own, and it is the fastest way to find out which of the installed fonts a problem belongs to.

Font family and style names​

A font file can name its family and its style - for example Regular or Bold - in more than one place inside the file, and these places do not always agree. The server prefers the name shown by Windows, Word and Chromium: the family and style stated in the font's Windows name record, then the same record's symbol encoding, then the font's Unicode name records, and the Macintosh name record last; within that order, a readable name is preferred over one that could not be decoded correctly.

Since 10.0.8, every web service ignores blanks around a font name - in a request, including the font names of the text watermark, the header/footer and the free text annotation of the "Toolbox" web service, and in its defaultFont -, and a name of blanks only counts as no name, as if none were specified. A font whose family name itself begins or ends with a blank therefore cannot be named, neither in a request nor as the default font.

A font whose Windows name differs from its Unicode name was previously found only under the Unicode one. It is now additionally found under its Windows name, and every name it was registered under before stays registered. Only for such a font can a search return a different file than before: its new name can join a family another font file already provides and fill a missing style there, or come first in a search that returns the first name match. A name that could not be decoded correctly is no longer registered; the font stays available under its readable name.

note

This selection applies to TrueType, OpenType and TrueType Collection fonts and is on by default. Restore the previous selection - the family and style name reported from the Unicode records - with the environment variable WEBPDF_FONT_NAMES_WINDOWS_FIRST_ENABLED=false or the system property -Dwebpdf.font.names.windows.first.enabled=false.

Directories​

In Windows, fonts must be installed (registered) in <Windows>\fonts. In addition, the server reads the font folder of the Windows account it runs under (%LOCALAPPDATA%\Microsoft\Windows\Fonts) and its subfolders, the location Windows uses when a font is installed "for the current user only".

caution

Prefer installing fonts system-wide over installing them only for the account the server runs under: a system-wide installation is available to every web service regardless of which account starts it, while the per-user folder above depends on that one account.

Under Linux, fonts are looked for in the folder /usr/share/fonts (and its subfolders). Additionally, the folder .fonts in the home directory of the user account under which the server is running is used, together with its subfolders. The home directory is the one Java reports for that account (system property user.home), for example /home/webpdf/.fonts in the Docker image.

note

Since 10.0.8, fonts in subfolders of the font folder of the user account are read like the subfolders of the other font directories; before, they were not read.

caution

The sum of all directories with fonts must not be longer than 256 characters.

Because the fonts are divided into subdirectories, the list of the directory names can exceed the character limit of 256. In this case, merge the fonts into one (or a few) directories. For a web service with its own fontPath, useUserFonts="false" also removes the font folder of the user account and its subfolders from the list (see "Custom font directory" below).

The list of used directories for fonts is displayed at server startup at the respective web service. Only directories where at least one font was found are used.

When the "Toolbox" and the "Converter" web service read the same directory with the same options - the default, because both scan only TrueType fonts and TrueType Collections - the server scans that directory once at startup and shares the result between them instead of scanning it twice. Each web service still determines its own default font (see "Default font" below) independently, and a custom font directory (see "Custom font directory" below) configured for one of them is unaffected. This can be switched off with the environment variable WEBPDF_FONT_SCAN_REUSE_ENABLED=false or the system property -Dwebpdf.font.scan.reuse.enabled=false, so that every web service scans its font directory on its own again, as before.

The server searches all folders for fonts. At least one valid font must be found in the folders a web service reads: its base directory, the subfolders of the base directory and - unless it is switched off with useUserFonts="false" for a configured fontPath - the font folder of the user account with its subfolders. Since 10.0.8 this applies under Windows and Linux alike; before, under Windows a font had to lie directly in the base directory, and fonts only in its subfolders kept the web service from starting. If no font is found, then the startup of the respective web service is cancelled and the web service will not be available.

note

The "OCR", "Barcode" and "Signature" web services start without fonts only if no fontPath is configured for them: the server then writes a warning to the log. A configured fontPath that cannot be used - it does not exist, cannot be read or is invalid (for example a value that contains * or quotation marks), or no font is found in it, in its subfolders and, as long as useUserFonts is not false, in the font folder of the user account - keeps every web service from starting, these three included; the server log names the directory, the attribute and the web service instead of a stack trace. Since 10.0.8, blanks around fontPath and defaultFont are ignored for every web service, and a value of blanks only counts as no value. With blanks around fontPath, earlier versions could keep the "Converter", "Pdfa" and "Toolbox" web services from starting. A directory whose own name begins or ends with a blank can therefore not be configured as fontPath.

Since 10.0.8, the configuration check font of the administration API applies this rule to the fontPath of a configuration before it is saved: a font directory that would keep a web service from starting is refused with ADMIN_CONFIG_VALIDATE_ERROR (-48), and nothing is saved. The check looks at the directories of the server that handles the request, and only at web services that are enabled.

caution

If you have created your own fonts, for example, to support your corporate design, then be certain that these fonts are available on the server.

Custom font directory​

An individual font directory can be specified for the "Converter", the "Pdfa" and the "Toolbox" web service via the configuration in the Admin Portal. In this case, the fonts from the configured directory and all its sub-directories are used instead of the font directories of the operating system. This provides the possibility to set up an individual list of fonts for the server only.

The font folder of the user account under which the server is running (see "Directories" above) is read in addition by default. Since 10.0.8, set the attribute useUserFonts of the web service to false, in application.xml or in the Admin Portal, to use only the configured directory and its sub-directories. Every web service with a font directory has this attribute: converter, pdfa, toolbox, signature, ocr and barcode. It applies only when fontPath is set; without fontPath, the font directories of the operating system and the font folder of the user account are always read. The value is read when the server starts; a change takes effect after a restart.

<converter fontPath="D:\fonts" useUserFonts="false"/>
note

When the "Toolbox" and the "Converter" web service read the same fontPath, they share the scan only if useUserFonts has the same value for both; otherwise each of them scans the directory on its own.

caution

Each of these web services has its own directory and is configured separately. Changing the directory of one of them does not change the fonts used by the others. A web service for which no directory is configured continues to use the font directories of the operating system described above.

A custom font directory is also the way to keep a single font file away from a web service: if a font that is installed on the system cannot be processed (see "Diagnosing font problems" above) and cannot be uninstalled, point the affected web service at a directory that contains only the fonts you control.

Default font​

webPDF installs the default font "Go Noto Current" and uses it as the default font (see above) . This font has a large coverage of the Unicode range and is therefore suitable as the default font if the font defined in the document is not available during conversion.

The default font of a web service is the first of the following fonts that is found in the font directories of that web service: "Go Noto Current", "DejaVu Sans" and "Arial Unicode MS". Under Windows, "Arial" is tried as a last resort. A font that you configure as the default font of the web service always takes precedence (see below).

caution

Earlier versions preferred Arial Unicode MS over Go Noto Current. This order has changed: on a server where Arial Unicode MS is installed in the font directories of a web service, Go Noto Current is now the default font; on a server without Arial Unicode MS, nothing changes. If Go Noto Current is missing in the font directories of the web service (for example with an individual font directory) and DejaVu Sans is present there, DejaVu Sans is the default font instead of Arial Unicode MS. DejaVu Sans covers considerably fewer characters than Go Noto Current and has no Hangul and no CJK ideographs. Besides that, "Go Noto Current" is about 6 % wider than Arial and Arial Unicode MS, so line breaks can change in documents that are set in the default font. To restore the former default font, set defaultFont="Arial Unicode MS" for the "Converter" web service (and for the "Toolbox" and "Signature" web services, if you use them), as described below.

In the Admin Portal, an individual font can also be defined as the default font for the "Converter" web service. If a font is specified there, then this will be used as the default font. If no font is defined there or an invalid font name is specified, then the previously described default font is used.

Since 10.0.8, the "Converter" web service ignores blanks around its defaultFont: a value such as " Arial " selects the font Arial. Earlier versions did not find a font with such a value and used the order above without a message. If the configured font is not found in the font directories of the "Converter" web service, the server log shows a warning at startup, the web service starts, and the order above applies.

The default font is not only the substitute for a missing font during a conversion. It is also the font the "Toolbox" web service draws with whenever a request specifies no font name: the text watermark, the header/footer and the free text annotation all fall back to it, and the selected font is embedded in the resulting document. Each web service resolves the default font from its own font directory (see "Custom font directory" above), so the "Toolbox" web service can use a different default font than the "Converter" web service.

caution

Only if no usable default font can be determined - for example because no font directory is available to the web service, because the directory contains none of the fonts of the order above or the configured font, or because the font file found cannot be read or has a damaged character mapping - does the "Toolbox" web service fall back to the standard font Helvetica, which is not embedded in the document. A font file that cannot be read, or whose character mapping is damaged, is reported with a warning in the server log. A request that names such a font explicitly is rejected with an error instead.

The default font of the "Toolbox" web service is set in application.xml with the optional attribute defaultFont of the element webservices/toolbox (default: empty). With an empty value, the font is chosen from the order above. The value is the family name or an alternative name of an installed font; upper and lower case count, and a PostScript name is not accepted. A substitute font (see "Substitute fonts") does not apply to this name. The value takes effect after a restart of the server. This version has no environment setting for it; use a placeholder such as ${WEBPDF_TOOLBOX_DEFAULT_FONT:-} in the file.

<toolbox defaultFont="Arial Unicode MS"/>

If the configured font is not found in the font directories of the "Toolbox" web service, the server log shows one warning at startup, the web service starts, and the order above applies. The server log also names the default font that the "Toolbox" web service uses.

caution

The font must allow embedding as a subset (field fsType of the OS/2 table of the font file). A font whose license forbids this makes every request without a font name that embeds a subset end with an error while the document is written; the warning at startup does not detect this. A request that specifies no font name is answered with Helvetica if no font of the order above, and no configured font, can be used. A watermark, header/footer or free text annotation that contains a character the determined font does not cover is rejected with an error instead of being drawn.

note

The requested style is only applied if the determined font family provides it. A family without an italic or a bold cut is used in its regular cut instead - exactly as it is when the font is specified by name. No style is simulated. The bundled "Go Noto Current" provides a regular, a bold, an italic and a bold italic cut. The italic cuts are italic for Latin, Greek and Cyrillic; the characters of all other scripts stay upright.

Fonts of the OCR and Barcode web services​

When the "OCR" and the "Barcode" web service render a page, they draw annotations and form fields that have no appearance of their own. A character that the font of such an annotation does not have is drawn with a substitute font from the font directories of the web service, as described in appearance of annotations and form fields. Both web services have their own font management for this, like the "Toolbox" and the "Signature" web service. It is set in application.xml with two optional attributes of the elements webservices/ocr and webservices/barcode:

AttributeDefaultDescription
fontPathemptyThe base path, including subfolders, from which the fonts are read. Empty means the font directories of the operating system (see "Directories"). The font folder of the user account that runs the server is read in addition, with its subfolders; with a configured fontPath only as long as useUserFonts is not false.
useUserFontstrueSince 10.0.8. Applies only when fontPath is set: true also reads the font folder of the user account that runs the server, false reads only fontPath and its subfolders (see "Custom font directory").
defaultFontemptyThe font that is tried first for a character that the font of an annotation does not have. The value is the family name or an alternative name of an installed font; upper and lower case count, and a PostScript name is not accepted. A substitute font (see "Substitute fonts") does not apply to this name. Empty means the order described under "Default font".

This version has no environment settings for these attributes; use a placeholder such as ${WEBPDF_OCR_FONT_PATH:-}, ${WEBPDF_BARCODE_DEFAULT_FONT:-} or ${WEBPDF_OCR_USE_USER_FONTS:-true} in the file. The settings are read at startup; a change takes effect after a restart.

<ocr fontPath="/opt/fonts" defaultFont="Go Noto Current"/>
<barcode defaultFont="Go Noto Current"/>

Without a configured fontPath, both web services start even if no font can be read: the server log then shows a warning. A configured fontPath that cannot be used keeps the web service from starting (see "Directories"); since 10.0.8, the configuration check font of the administration API refuses it before it is saved, and skips both web services without fontPath. An annotation or form field without an appearance whose text needs a substitute font ends the request with -1213 in this case. A defaultFont that is not found in the font directories is reported with a warning at startup; the other fonts of the substitution chain are used. The substitute fonts of fontSubstitution (see "Substitute fonts") now also apply to a font that an annotation of a page rendered by these web services names and that is not installed.

note

Without any setting the "OCR" and the "Barcode" web service read the font directories of the operating system and the font directory of the user account, as every web service without an own fontPath does. Go Noto, which is installed with webPDF, is therefore available to them without configuration.

Fonts installed with webPDF​

The Windows setup and the DEB and RPM packages install the following fonts; the Docker image contains them as well. They are licensed under the SIL Open Font License 1.1.

Font familyStylesContent
Go Noto CurrentRegular, Bold, Italic, Bold ItalicThe scripts in current use, based on Noto Sans 2.015, including Tibetan. The italic styles are italic for Latin, Greek and Cyrillic; every other script stays upright. Also covers all box-drawing and block-element characters (U+2500-259F, drawn 0.6 em wide in every cut), CJK symbol and form variants (ideographic description characters, Kanbun, vertical forms, small form variants), Unified Canadian Aboriginal Syllabics, Ogham, Old Italic and monochrome emoji. Regional indicators, skin tones, tag characters and private-use code points are not included; emoji sequences such as flags are still set by "Go Noto Emoji". Hangul syllables and rare Han characters are not included either; they are in "Go Noto CJKCore" and "Go Noto CJKExt".
Go Noto Current SerifRegularThe serif counterpart for the scripts in current use.
Go Noto CJKCoreRegular, BoldCommon Han ideographs, all Hangul syllables and Kana.
Go Noto CJKExtRegular, Bold8,602 further CJK ideographs of Noto Sans CJK that "Go Noto CJKCore" lacks: the remainder of the unified block, Extension A, and parts of Extension B and later.
Go Noto EmojiRegular, BoldMonochrome emoji (Noto Emoji). Colour emoji, skin tones, flags and ZWJ sequences are not supported, because only outlines are drawn when a font is embedded in a PDF document.

Which font is used as the default font does not change (see "Default font" above).

Substitute fonts​

A document often names a font that is not installed on the server, most often Arial, Calibri or Times New Roman from Windows. The server then replaces it with a substitute font of the same metrics, so that line breaks and page breaks stay as they are with the original. The substitution is on by default, but it does not apply to every web service and every conversion. The following table shows where it is used and where it is not.

Where substitute fonts are used​

Web serviceConversion or functionSubstitute fontsRemark
ConverterWord documents (.docx), native Word ConverterYes
Converter.docx documents attached to an e-mailYesThe attachments are converted by the native Word Converter.
Converter.docx with the native Word Converter switched off (enabled="false" in converter/office/word of the request)NoOutside In converts these documents.
ConverterExcel workbooks (.xlsx), PowerPoint presentations (.pptx), all other Office formats (for example .doc, .xls, .ppt, .rtf) and every other format converted by Outside InNoOutside In uses its own font handling and the default font.
ConverterConversion through the Office Bridge or the SharePoint Online bridgeNoMicrosoft Office or SharePoint Online renders with its own fonts.
ConverterE-mail body (EML, MSG), HTML, MHTML, SVG and text filesNo (see remark)Rendered by the integrated browser. The substitute fonts of fontSubstitution do not apply; under Linux the browser uses the metric-compatible font aliases of the operating system (fontconfig), for example Arial and Helvetica by Liberation Sans, Times New Roman by Liberation Serif, Courier New by Liberation Mono, Calibri by Carlito and Cambria by Caladea, if the substitute is installed. Any other font that is not installed is drawn in the serif default font of the browser. For e-mails and HTML see "Fonts in HTML documents and e-mails"; the option adjustFonts has no effect.
URL ConverterWeb pagesNo (see remark)Rendered by the integrated browser, with the font aliases of the operating system as described for e-mails and HTML.
ToolboxText watermark, header/footer and free text annotation with a font name that is not installedYesAn installed font always wins. A character the substitute lacks gives the same error as for the original font.
ToolboxAll other operationsNot applicableThey select no font.
SignatureVisible signature appearance with a font name that is not installedYes
SignatureConfigured defaultFont of the signature and the PDF standard font HelveticaNo
PdfaPDF/A conversionNoThe external PDF/A tool reads the font folders itself.
OCR, BarcodeAnnotations and form fields without an appearance, drawn when a page is rendered, with a font name that is not installedYesSee "Fonts of the OCR and Barcode web services".

Built-in pairs​

Font named in the document or requestSubstitute font
Arial, HelveticaLiberation Sans
Times New RomanLiberation Serif
Courier NewLiberation Mono
CalibriCarlito

The table is built into the server. Cambria has no built-in pair; add one yourself if you want it (see "Configuration" below).

How the substitution works​

  • An installed font always wins. The substitute is only looked for when the font is not installed. If a family is installed only partly, for example without its italic cut, the installed cuts are used as before.
  • The substitute must be installed. The server looks for it in the font directories of the web service (see "Directories" and "Custom font directory" above). If it is not there, the behavior is the one of previous versions. The DEB packages require the Liberation fonts; Carlito, and Liberation under Windows, have to be installed separately. See "Fonts under Linux" below.
  • Style is kept. A bold or italic request is answered with the bold or italic cut of the substitute.
  • The alternate font of a Word document comes first. If a Word document names alternate fonts for a font that is not installed, the first of them that is installed is used before the substitute font. See font resolution of the Word Converter.
  • The character set has to fit. A substitute is not used for text that needs a character set the substitute does not support, for example Korean text. That text is handled as without a substitute.
  • The default fonts are not substituted. The default font of the "Converter" web service, the default font of the "Toolbox" web service and the default font of the "Signature" web service (see "Default font" above) are always looked up by their own name. Configuring Calibri as the default font does not select Carlito.
  • The case of the name is ignored by the "Converter", the "OCR" and the "Barcode" web service. The "Toolbox" and the "Signature" web service compare the name exactly: arial does not select the substitute of Arial.

Toolbox and Signature​

A text watermark, header/footer or free text annotation of the "Toolbox" web service that names a font which is not installed is drawn with the substitute font, and the substitute is embedded in the document. The font name stored in a free text annotation is the one of the substitute. A character that the substitute does not have is rejected with the same error as for the original font; there is no further fallback.

The "Signature" web service applies the substitute to the font that a request names for the visible appearance, which stays binding in the same way. Helvetica remains the standard font of the PDF format there, which is not embedded. The configured default font of the signature is not substituted.

Native Word Converter​

For a font that is not installed, the native Word Converter does not choose the replacement by the font name alone. A Word document can name alternate fonts for a font (w:altName); the first of them that is installed is used before the font of the same metrics. After that, the configured substitute font, the font that the server used before substitute fonts existed and the default fonts are checked, and the first font that draws all characters of the text is used. The stages, their order, the choice by the characters of the text, the handling of text without characters and of symbol fonts, and the fall back are described in the section font resolution of the Word Converter; the order is not repeated here.

A Korean text in a font that is not installed is therefore drawn with "Go Noto CJKCore", also when Carlito is installed. If no font draws all characters, the font that draws most of them is used. The choice is made per request and font, not per character: a single character that the substitute lacks, for example a hyphen (U+2010), moves the whole text to the next font that has it. Characters that no installed font draws are drawn as the font's .notdef glyph - usually an empty box - where the font provides one, otherwise they are left out.

Reports of the native Word Converter​

The native Word Converter reports the replacement in the conversion report, requested with the fontIsMissing and fontAliasUsage options of the converter's report parameter:

  • A replacement that covers the text - the alternate font named by the document, the substitute font, the default font or another font chosen by the characters - is reported as alias usage (CONVERTER_FONT_ALIAS_USED, error code -107). This is also the case when the default font replaces a missing font, as before.
  • A font is reported as missing (CONVERTER_FONT_IS_MISSING, -108) when no installed font declares the character set of the text and the default font is used instead, when a font that was found cannot be used, and when the font that draws the text - the requested font or its replacement - has no glyph for characters of the text. In the last case the report names the font and the characters (up to 32 code points per font, as U+XXXX).

Configuration​

The substitution is configured in the webservices element of application.xml. The element is optional; without it the substitution is on and the built-in table applies.

<webservices>
<fontSubstitution enabled="true" useDefaults="true">
<substitute font="Cambria" replacement="Caladea"/>
</fontSubstitution>
</webservices>
AttributeDefaultMeaning
enabledtrueSwitches the whole substitution off with false. The server then behaves as before substitute fonts existed: no substitute font, no alternate font named by the document, no choice by characters. Characters that the font in use cannot draw are still reported.
useDefaultstruefalse switches off only the built-in pairs of the table above. The alternate font named by the document and the choice by characters stay on.
substitute (font, replacement)noneAn own pair. It adds to the built-in pairs and replaces the built-in pair of the same font. An entry with an empty font or replacement, a font that is its own replacement and a second entry for the same font are ignored; the server logs a warning at startup. A replacement is not replaced again: with A→B and B→C, A is substituted by B only.

The built-in pairs belong to the server version. Whoever sets useDefaults="false" with own entries keeps a fixed table.

This version reads the settings from application.xml only; there are no dedicated environment settings or system properties. In a container, make the values configurable with a placeholder in the file, which is expanded before the file is read, for example <fontSubstitution enabled="${WEBPDF_FONT_SUBSTITUTION_ENABLED:-true}" useDefaults="${WEBPDF_FONT_SUBSTITUTION_USE_DEFAULTS:-true}"/>. The variable names are free to choose; the part after :- is the default. The settings are read at startup; a change takes effect after a restart.

caution

Substitute fonts change the appearance of existing documents: a document that was set in the default font because Calibri was missing is now set in Carlito, a Word document is set in an alternate font that it names itself and that is installed, and the report of the native Word Converter can change (see above). Switch the substitution off with enabled="false" (or the placeholder variable above set to false) to get the previous behavior back.

At startup the server writes the effective table of each of the three web services to the log, with the origin of each pair (built in or configured) and whether the substitute is installed. The Admin Portal's server status (GET /admin/server/status) returns the same table for each of these web services, including whether the substitute is available on the node that answers. It is not part of the public portal/info.

note

In a cluster, install the same fonts on every node. Whether a substitute is available depends on the fonts installed on a node, so the same conversion can be set in different fonts on different nodes.

Font decisions in the native Word Converter​

The native Word Converter judges a font before it is used, not only when it cannot be found. A font that was found but cannot be used - because it cannot be read, because its license does not permit embedding, or - only when the font is embedded in the resulting document - because its glyph data or its character map is damaged - is replaced exactly like a missing font. The replacement follows the same chain as a missing font: first the default font described above, and if that cannot be used either, the built-in font Helvetica. A font that cannot be used is written to the server log as a warning, naming the font file and the reason - once per state of that file, not once per conversion.

note

A font whose license permits embedding but forbids subsetting is not replaced when it is embedded: it is embedded completely instead of as a subset, with a warning in the server log. Without embedding, such a font still ends the conversion with an error, as before.

The default font itself is checked once, at server startup, with the strictest of these rules. A problem found there is written to the server log only; it neither prevents the web service from starting nor appears in the Admin Portal.

caution

The Word Converter does not embed fonts by default (embedFonts is off). The checks that only apply to an embedded font - the glyph data and character map checks above - therefore do not run against the default configuration.

The native Word Converter can report these decisions in its conversion report: a font that is not found is replaced by a font that covers the character set and the characters of the text - the substitute font, the default font or another installed font (see "Substitute fonts" above) - and this is reported as alias usage (CONVERTER_FONT_ALIAS_USED), also when the default font is used. A font is reported as missing (CONVERTER_FONT_IS_MISSING) only if no installed font declares the character set of the text and the default font is used instead, if a font that was found cannot be used and was replaced by the default font or Helvetica, or if the font that draws the text - the requested font or its replacement - has no glyph for characters of the text; these characters are then drawn as the font's .notdef glyph where the font provides one, otherwise left out, and are named in the report. If that alias font cannot be used either, only the missing font is reported. See error codes for both. The report names the font that is actually used, never a server file path.

Subsetting the embedded fonts​

The embedFonts attribute of the converter parameter node switches embedding on for the converted document. The subsetFonts attribute decides what is embedded then:

embedFontssubsetFontsResult
false (default)anyNo font is embedded. subsetFonts has no effect.
truetrue (default)Only the glyphs the document uses are embedded (a font subset).
truefalseThe complete font program is embedded. The converted document becomes considerably larger, tens of megabytes for a Unicode-wide family.

subsetFonts is evaluated only by the native Word Converter, that is, for docx documents. Conversions by the Office Bridge, the SharePoint Bridge or Outside In do not read it. Without the attribute, the behavior is the one of previous versions: a subset. To return to it, omit the attribute or set it to true.

{
"converter": {
"embedFonts": true,
"subsetFonts": false
}
}
note

A font whose license permits embedding but forbids subsetting is embedded completely even with subsetFonts set to true, with a warning in the server log (see above). Conversely, a single face of a TrueType Collection that cannot be written out as a standalone font is embedded as a subset even with subsetFonts set to false, again with a warning in the server log. Font names in the document are matched ignoring the case.

Font embedding​

A font the "Toolbox" web service draws with is embedded in the resulting document, so that the document shows the same text on a machine on which that font is not installed. This applies to the text watermark, the header/footer and the free text annotation, whether the request names the font or is answered with the default font described above.

By default only a subset of the font is embedded - exactly the glyphs the drawn text uses. That is what keeps such a document small: a Unicode-wide family like "Go Noto Current" or "Arial Unicode MS" measures tens of megabytes, while a subset of a few characters measures kilobytes. The document is self-contained either way.

What a subset gives up is later editing. A free text annotation can be edited in a PDF viewer, and an editor can only set a character for which the embedded font program carries a glyph - with a subset, that is exactly the characters the annotation already contained.

An editor reaches that program through the annotation's rich text (/RC, /DS) and the font of the same name in the document's default resources (/DR). The annotation's default appearance (/DA) names the standard font Helvetica, so an editor that regenerates the appearance from that alone does not use the embedded program at all - the complete program is worth asking for when the consumer honours the rich text.

A request that needs that ability asks for the complete font program with the subsetFont attribute of the font element of a free text annotation:

<font name="Arial" size="10" subsetFont="false"/>
caution

A subsetFont that is set explicitly always takes precedence. In particular, subsetFont="false" also embeds the default font completely, although a request that names no font did not choose that font - and the complete program of a Unicode-wide default font makes the resulting document tens of megabytes larger. Set it together with a font your request names, unless that size is intended.

note

A font program that cannot be written out as a standalone font is embedded as a subset even when subsetFont="false" was requested. This can happen for a single face of a TrueType Collection whose internal table sizes are declared too small. The annotation is drawn unchanged; the server notes the fallback in its log.

Several free text annotations that use the same font share one embedded program, and its subset holds the characters of all of them together. The text watermark and the header/footer always embed a subset and offer no such attribute.

The same sharing also reaches across operations and requests. When the document already carries a font program that webPDF itself embedded earlier - by a previous operation of the same "Toolbox" call, by a previous call, or by the conversion of an Office document by the "Converter" web service - a text watermark, header/footer or free text annotation in the same font takes that program over instead of adding a second copy next to it. The document then carries one program, and its subset holds the characters of all uses. A chain of text watermark, header and free text annotation in Arial, for example, grows the document by about 24 KB instead of 42 KB.

A program is taken over only when it is verified to be the same font program, glyph by glyph; otherwise both stay in the document, as before. The rendered document is the same either way. A font program embedded by other software - for example by Microsoft Word or Adobe Acrobat - is left as it is, and a signed document is never changed this way, because its signature covers the existing objects.

note

A few characters are drawn with the same glyph as another character, for example the space and the no-break space, or the hyphen and the soft hyphen in Arial. Each of them keeps its own meaning when the text is copied or searched - also when one text mixes both characters, and when several uses of one embedded font, or a taken-over program, draw different characters of such a pair: webPDF gives every further character of a glyph its own character code in the embedded font. The rendered document is not affected. For the text watermark, the header/footer and the free text annotation this can be switched off with the environment variable WEBPDF_FONT_EMBEDDING_DISTINCT_CHARACTER_IDS_ENABLED=false or the system property -Dwebpdf.font.embedding.distinct.character.ids.enabled=false; both characters of such a pair are then extracted as one of them, as in earlier versions - as the one drawn first for a font embedded as a subset, and as the lowest character of the glyph (the space, the hyphen) for a completely embedded font.

The takeover can be switched off with the environment variable WEBPDF_FONT_EMBEDDING_REUSE_ENABLED=false or the system property -Dwebpdf.font.embedding.reuse.enabled=false. Every use then embeds its own program again.

Symbol character sets​

Under Linux, please be certain that the character sets Symbol, Wingdings and Webdings” which are commonly used under Windows are also installed. These fonts are often used in documents which have been created under Windows. If documents like these are converted under Linux and the fonts are not available, then no substitute can be found and the documents may contain gaps in the content.

A text watermark, a header/footer and a free text annotation of the Toolbox web service can be set in such a symbol font as well. A symbol font places its characters at U+F020 to U+F0FF instead of at their usual Unicode positions. As in Windows applications, a typed character of the range U+0020 to U+00FF that the font has no glyph for is drawn with the glyph the font places at U+F000 plus that character - “J” in Wingdings, for example, is drawn as a smiling face. A text that the font draws as typed is not changed. A free text annotation keeps the typed text in its contents; text copied or extracted from the drawn text yields the moved characters (U+F04A for “J”). A character that the font has no glyph for even then is rejected, the text is never shortened.

Fonts in HTML documents and e-mails (adjustFonts)​

caution

Deprecated. The option adjustFonts of the html and mail elements of the "Converter" web service (default: false) has no effect. The server ignores its value, and the fonts named in HTML documents and e-mails are passed to the integrated browser unchanged. The option is still accepted, so existing requests remain valid, and it may be removed in a future main version.

Earlier versions replaced entries of CSS font lists and of the face attribute of font elements that contained Arial, Helvetica or sans-serif when the option was set to true. The integrated browser resolves fonts itself; the replacement changed line breaks and font weights without displaying any additional character. Without it, a document is drawn with the fonts it names:

  • Under Windows, the installed fonts are used.
  • Under Linux, the browser uses the metric-compatible font aliases of the operating system (see the table of the "Converter" above), for example Arial and Helvetica by Liberation Sans, if the substitute is installed.
  • A font that is not installed is drawn in the serif default font of the browser. To avoid this, install the font or a metric-compatible substitute as a system font of the server, or end the font list of the document with a generic family such as sans-serif.

The “Arial Unicode MS” font​

The “Arial Unicode MS” font is a universal font that is not part of webPDF. It is only used as the default font if it is installed and no better font is found (see "Default font") or if you configure it. Its license is to be clarified by the operator. The font covers the complete range of Unicode characters and also defines a number of graphical symbols (e.g. checkboxes). If this font is available on the server, then the probability is very high that most documents will be able to be converted and there will be no loss of information or display features in the converted document resulting from missing characters of a font.

caution

If the font Arial Unicode MS is used as the default font, then you will see a corresponding message in the server log.

Fonts under Linux​

The first requirement is to install the fonts that the documents use, or your company's own fonts. Under Linux this is practically mandatory: only few fonts are installed, and Office documents usually come from Windows. Substitute fonts of the same metrics are the next best choice. The tables below show which ones exist and which packages provide them.

In Linux, install support for TrueType fonts (TTF) (in Debian Linux) and search for packages that provide TTF fonts for your distribution.

On Debian:

apt-get install fontconfig
caution

On Linux it is recommended to install at least the fonts Liberation, DejaVu and OpenSymbol.

On Debian:

apt-get install fonts-liberation2 fonts-dejavu fonts-opensymbol

On Debian:

apt-cache search ttf

Substitute fonts on Linux​

"Same metrics" means identical advance widths and line height in all four styles (regular, bold, italic, bold italic), so that line breaks and page breaks stay as in the original. The data was measured on 2026-10-08. The column "Built in" tells whether the server uses the pair without any configuration (see "Substitute fonts").

Font in the documentSubstitute fontFitsBuilt in
Arial, HelveticaLiberation SansSame metrics. No Arabic, some Greek and Cyrillic characters and newer currency signs (₹ ₽ ...) missing.yes
Times New RomanLiberation SerifSame as above.yes
Courier NewLiberation MonoSame as above.yes
CalibriCarlitoSame metrics (with kerning within ±0.1 %). No Hebrew and Arabic, less Cyrillic, no soft hyphen U+00AD and hyphen U+2010.yes
CambriaCaladeaOnly version 1.002 has the same metrics (no Greek, no Cyrillic). Version 1.001 (Debian, Google Fonts) has proportional digits: the text is about 1–5 % narrower and the line height differs.no – add your own substitute entry where version 1.002 is installed
Times New Roman, Courier New (alternative)Tinos, CousineSame metrics; Apache 2.0 license.no – own entry
GeorgiaGelasioSame widths, but a taller line height (1.66 instead of 1.14 em). No Greek, no Cyrillic.no – install manually (Google Fonts, OFL license), own entry
Segoe UISelawikSame widths for Regular, Light and Bold; no italic. Only about 350 characters, no no-break space U+00A0.no – install manually (github.com/microsoft/Selawik, OFL license), own entry
Comic Sans MSComic ReliefSame widths (Regular; Bold except Cyrillic); no italic.no – install manually (Google Fonts, OFL license), own entry

Packages that provide the substitute fonts:

Substitute fontDebian 12Debian 13RHEL/AlmaLinux 8RHEL/AlmaLinux 9openSUSE Leap 15.6
Liberation Sansfonts-liberation2 (2.1.5)fonts-liberation (2.1.5; fonts-liberation2 is a transitional package)liberation-sans-fonts (2.00.3, BaseOS)liberation-sans-fonts (2.1.3, AppStream)liberation-fonts (1.07.4: same metrics for Latin, only about 660 characters)
Liberation Seriffonts-liberation2fonts-liberationliberation-serif-fontsliberation-serif-fontsliberation-fonts
Liberation Monofonts-liberation2fonts-liberationliberation-mono-fontsliberation-mono-fontsliberation-fonts
Carlitofonts-crosextra-carlito (1.103)fonts-crosextra-carlito (1.104)google-crosextra-carlito-fonts (AppStream)google-carlito-fonts (AppStream)google-carlito-fonts
Caladeafonts-crosextra-caladea (1.001, does not fit)fonts-crosextra-caladea (1.001, does not fit)google-crosextra-caladea-fonts (1.002, AppStream)google-crosextra-caladea-fonts (1.002, AppStream)google-caladea-fonts (1.002)
Tinos, Cousinefonts-croscorefonts-croscorenot availablegoogle-tinos-fonts, google-cousine-fonts (EPEL)noto-tinos-fonts, noto-cousine-fonts
Gelasio, Selawik, Comic Reliefnot packagednot packagednot packagednot packagednot packaged

The webPDF DEB packages require the package fonts-liberation2; on Debian 13 this transitional package installs fonts-liberation.

note
  • For Aptos, Verdana, Tahoma, Trebuchet MS, Consolas, Candara, Constantia, Corbel, Franklin Gothic and Gill Sans MT no free substitute with the same metrics was found. The TeX Gyre fonts for Palatino, Bookman, Century Gothic and Century Schoolbook are only similar.
  • The original Microsoft core fonts (Arial, Times New Roman, Courier New, Georgia, Verdana, Trebuchet MS, Comic Sans MS and others; not Calibri, Cambria, Segoe UI and Aptos) can be installed with an installer package that downloads them: ttf-mscorefonts-installer on Debian (component contrib) and fetchmsttfonts on openSUSE. There is no such package for RHEL/AlmaLinux. The fonts are under a Microsoft license that you have to clarify before using them.
  • Under Windows, Arial, Times New Roman, Courier New, Calibri, Cambria, Georgia, Segoe UI, Comic Sans MS and Palatino Linotype come with Windows itself; Book Antiqua, Bookman Old Style, Century Gothic, Century Schoolbook and Aptos only with Microsoft Office (see the Microsoft typography font list). Under Windows the substitute fonts are therefore normally not needed.
  • For the pairs that are built in and for your own pairs (the fontSubstitution configuration with substitute entries, for example Cambria → Caladea where version 1.002 is installed) see "Substitute fonts" and its subsection "Configuration".

After installing fonts, make sure to rebuild the Linux distribution’s "font cache" and restart the webPDF server in order to enable the changes. The server reads the fonts at startup.

On Debian:

fc-cache -fv