0.010/29/2019

FAQ-1519: Font selection and order of execution

Description:

Why would a selected font sometimes not embeded in a PDF produced by PlanetPress, or replaced with another font?

Content:

While the Font Type list gives the impression that it selects a font type (PS printer, TT host, etc.), what it actually does is filter the list of available fonts according to their type. The user ends up selecting a font name, regardless of its type.

When producing the output, the font type selected in the Style dialog is completely ignored. Instead, the font name is resolved in the following order:

  1. Host-based PostScript (installed using Install PostScript Font)
  2. Printer fonts (those found in the PPD)
  3. TrueType (technically, either TrueType or TrueType-flavored OpenType installed in the Windows Fonts folder)

In other words, if you installed a TrueType Helvetica font in Windows and select it in the Style dialog (TT, host, single-byte), you will end up using the Helvetica font from the printer (since all PDDs have Helvetica), not the one installed in Windows. Unless of course you installed the PostScript Helvetica font in PlanetPress, in which case this one will be used. I'm hereafter assuming this is not the case.

When creating a PDF, the PostScript job produced by PlanetPress is "printed" using our internal PostScript interpreter, which is called PlanetPress Alambic (a tongue-in-cheek reference to Distiller, with which it shares some source code). Alambic is a full-fledged Level 3 PostScript interpreter and as such provides a complement of standard fonts, among which is the Helvetica family. These fonts happen to be TrueType fonts. Therefore, if the PostScript job references a standard font such as Helvetica, the Alambic-based TrueType font will end up in the PDF if font embedding is enabled. That is why there are an Helvetica and an Helvetica-Bold TrueType font in the PDF for the text that repectively use Helvetica and Helvetica-Bold in their style definition. If the PostScript job had been printed, it would have used Helvetica and Helvetica-Bold from the printer.

If the selected name doesn't match an installed PostScript font or one from the PPD, then and only then is the TrueType font is used. For technical reasons, the produced PostScript job will contain one font per selected font name per encoding. In other words, if I have three styles defined, each using Helvetica but two of them with the Windows-1252 encoding and the third with the ISO-Latin-1 encoding, the PostScript job will contain two distinct fonts, even though the source font is the same (here Helvetica). Since you cannot have two fonts with the same name in a PostScript job, the two fonts need to have distinct names as well. That is why we use the name of the encoding in addition to font name in the new font definitions. At the same time, the source font is converted to a PostScript Type 1 font so that it can be understood by any printer. That is why Helvetica [BOLD], Helvetica [ITALIC] and Helvetica [BOLD ITALIC] end up as Type 1 fonts with the long name.