property FontData[Index: Integer]: TBytes; // read only
Returns the raw bytes of the embedded font program for the text page object at Index (only populated when the font is embedded). The valid range is 0 .. ObjectCount - 1 for a text object on the current page
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
| Index | Zero-based page object index in 0 .. ObjectCount - 1 referencing a text object (ObjectType[Index] = otText) |
FontData and a TrueType/OpenType parser
var
I: Integer;
RawFont: TBytes;
begin
for I := 0 to Pdf1.ObjectCount - 1 do
if Pdf1.ObjectType[I] = otText then
begin
RawFont := Pdf1.FontData[I];
Memo1.Lines.Add(Format('%s (%d bytes)', [Pdf1.FontFamilyName[I], Length(RawFont)]));
end;
end;