EmbedMissingFonts

Text, Fonts

Description

Scans the document for used fonts that lack an embedded font program and attempts to embed them from the system

Syntax

Delphi

Function TPDFlib.EmbedMissingFonts: Integer;

Parameters

None

Return values

0No missing fonts were successfully embedded
Non-zeroNumber of fonts successfully embedded or success indicator

Remarks

An installed font is used only when it is the requested family, spaces and case aside, and its face carries the requested bold and italic style, read from the BaseFont suffix such as ,Bold, -BoldMT or -Oblique. A substitute the system font mapper would pick, or a regular face that would only be emboldened on screen, is not embedded, so the font stays unembedded rather than receiving a program whose glyphs and widths differ

A glyf-based TrueType program goes into TrueType and CIDFontType2 fonts as FontFile2; a CIDFontType0 font receives only an OpenType CFF program, written as FontFile3 /OpenType. On Windows, installed fonts are resolved through the system font table; on headless non-Windows targets (Linux and macOS), standard system and user font directories are scanned automatically. Type 1 fonts are not embedded by this method