THPDFPage.SetEmbeddedGlyphFont Method
Version 2.1102.0 adds ordinary native CFF2 text and portable CFF1 font embedding. Registered names select the frozen font bytes directly; cmap and hmtx supply glyphs and metrics, with per-font BMP/SMP mappings and a CIDFontType0C stream retaining all original glyph slots
Selects validated caller-owned font bytes without installing or resolving the face through GDI
Declaration
function SetEmbeddedGlyphFont(
const FontIdentity: AnsiString;
const FontData: TBytes;
FontCollectionIndex: Integer;
ASize: Single): boolean;
Parameters
FontIdentityis a stable document-local cache identity for the supplied programFontDatacontains a TrueType, OpenType, or TrueType Collection programFontCollectionIndexselects a zero-based TTC member and must be zero for a standalone fontASizeis the positive font size in page units
Behavior
- Validates the sfnt tables, glyph count, units per em, cmap, metrics, and finite size before changing the current font
- Rejects restricted and bitmap-only embedding permissions and honors the no-subsetting bit
- Builds cached BMP and supplementary-plane cmap lookups plus per-glyph advances
- Writes the font program's signed
post.italicAnglein degrees to the PDF font descriptor, preserving fractional slant through the PDF numeric writer and setting the Italic flag for a nonzero angle - Uses zero when the supplied program has no readable italic-angle field; OpenType italic style classification alone does not imply geometric slant
- Returns false without selecting the font when validation fails
Related APIs
THPDFPage.GetEmbeddedGlyphID · THPDFPage.DrawEmbeddedGlyphRun