property FontFamilyName[Index: Integer]: WString; // read only
FontFamilyName returns the human-readable family name of the font referenced by the text page object at the given index. The family name is what designers and users normally call the font, and is independent of style suffixes like Bold, Italic, or Oblique. For the full PostScript name (which usually includes the style) see FontBaseName.
The indexer is the 0-based page-object index in the range 0..ObjectCount - 1. Only text objects carry a font; non-text objects return an empty string. A page must be active before the property is queried — set PageNumber first.
For embedded subset fonts the value still represents the source family even though the embedded glyph set is partial. When the PDF references a non-embedded font the name returned is whatever the producer declared; on systems where PDFium substitutes a different physical font for rendering, the family name reported here is still the requested one, not the substitute.
| Index | 0-based page-object index in the range 0..ObjectCount - 1. |
WString rather than ANSI.ABCDEF+) automatically.FontFamilyName + FontWeight + FontItalicAngle usually identifies the exact style being used.var
I: Integer;
Names: TStringList;
begin
Pdf1.PageNumber := 1;
Names := TStringList.Create;
Names.Sorted := True;
Names.Duplicates := dupIgnore;
try
for I := 0 to Pdf1.ObjectCount - 1 do
if Pdf1.FontFamilyName[I] <> '' then
Names.Add(Pdf1.FontFamilyName[I]);
Memo1.Lines.Assign(Names);
finally
Names.Free;
end;
end;