The font embedding controls in FFCore's Optimize component provide the following options:
There are a few things to consider when embedding fonts:
Font substitution is controlled via pdfToolbox Font Substitution Policy files. FFCore includes the standard policy files included with pdfToolbox.
Additional policy files can be created and uploaded to the FFCore sandbox.
The font substitution policies are plain text files with the following content:
DisplayName 1 My Special Name
SubstituteAll Arial Helvetica Helvetica Neue Futura Helvetica Neue Microsoft Sans Serif MS PGothic Trebuchet MS Verdana
SubstituteFirst Arial Bold Arial-Bold Helvetica Bold Futura-Bold Futura Bold Helvetica-Bold
The DisplayName defines the name that will appear in the pdfToolbox UI:
The DisplayName is not used by FFCore as it displays the filename in the sandbox.
The remaining lines specify which fonts may be substituted by which fonts and the precedence for substitution.
SubstituteAll - all fonts in the list are substituted for each other. When a font is missing pdfToolbox will work down the list until it reaches the name of an available font.
Config file syntax:
SubstituteAll<tab>fontname<tab>fontname<tab>fontname...
SubstituteFirst - only the first font in the list is substituted. pdfToolbox will work down the list until it reaches the name of an available font.
Config file syntax:
SubstituteFirst<tab>font to be substituted<tab>fontname...
SubstituteFirst also supports Regular Expressions for matching font names.
Example:
SubstituteFirst<tab>'(.*)Regular'<tab>Arial<tab>Helvetica
The above substitutes fonts whose "Fontname" includes "Regular" with Arial or Helvetica.
SubstituteFirst Regular Expressions also support backreferences.
Example:
SubstituteFirst<tab>'Helvetica(.*)'<tab>'Arial\1'
The above substitutes fonts whose "Fontname" starts with Helvetica with Arial variants. The portion of the "Fontname" after 'Helvetica' is retained and used in the new name via the backreference: \1
The above example replaces Helvetica-Bold with Arial-Bold and Helvetica-Italic with Arial-Italic
Regular Expression introduction: http://www.regular-expressions.info/quickstart.html
Note: Not sure about the comprehensiveness of pdfToolbox's Regular Expression support. I believe that it is fairly comprehensive and aligns with Perl Compatible Regular Expressions.
Note: the font names must match what pdfToolbox will find. The best way to ascertain that is to run a preflight on the file and copy the names off the report.
FFCore can also use pdfToolbox profiles with the Preflight component to embed fonts (and to perform other preflight checks and fixups). Using Preflight for font embedding allows use of additional options, including disabling the use of system fonts for embedding and allowing changes to the content that's evaluated when looking for fonts to embed