property FontData[FontIndex: Integer]: TBytes; // read only
Returns the raw bytes of the embedded font program (only populated when the font is embedded). The property is indexed by a font handle obtained from a character (FontHandle[CharIndex]) or directly enumerated through the page's font resources.
Read-only. The underlying value is queried lazily by PDFium from the font dictionary or font program. When the index does not match a known font, the function raises EPdfError.
Use this property together with CharacterFontSize / CharacterFontWeight to drive font-substitution or text-style reconstruction pipelines.
| FontIndex | Index of the font handle. Obtain via FontHandle[CharIndex] or by enumerating the page font resources. |
FontData and a TrueType/OpenType parser.
var
FontIdx: Integer;
begin
// inspect the font used by the first character
if Pdf1.CharacterCount > 0 then
begin
FontIdx := Pdf1.FontHandle[0];
Memo1.Lines.Add(Format('%s (embed=%s)',
[Pdf1.FontFamilyName[FontIdx], BoolToStr(Pdf1.FontIsEmbedded[FontIdx], True)]));
end;
end;