PDFiumVCL Docs

FontFamilyName property

Ten wpis API zachowuje identyfikatory, sygnatury, bloki kodu i terminy PDF w oryginalnej postaci.
Component: TPdf  ·  Unit: PDFium
Returns the typographic family name (e.g. Helvetica, Times New Roman, Noto Sans CJK SC) of the font used by a page object on the current page.

Syntax

property FontFamilyName[Index: Integer]: WString; // read only

Description

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.

Parameters

Index0-based page-object index in the range 0..ObjectCount - 1.

Remarks

Example

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;

See Also

FontBaseName, FontIsEmbedded, FontWeight, FontItalicAngle, FontHandle