Docs de PDFiumVCL

FontBaseName property

Esta entrada API conserva identificadores, firmas, bloques de código y términos PDF en su forma original.
Component: TPdf  ·  Unit: PDFium
Returns the PostScript base name (the /BaseFont entry from the PDF font dictionary) of the font used by a page object, including any style suffix such as -Bold or ,Italic.

Syntax

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

Description

FontBaseName returns the PostScript base font name as stored in the PDF font dictionary — this is the value of the /BaseFont key (PDF 1.7 section 9.6 / 9.7). For embedded subset fonts PDFium preserves the six-letter prefix (e.g. ABCDEF+Helvetica-Bold) so that the value remains a faithful copy of what the producer wrote. For a stripped, human-friendly family name use FontFamilyName.

The indexer is the 0-based page-object index (0..ObjectCount - 1). Only text objects produce a non-empty result; non-text objects return an empty string. A page must be active when reading the property.

The base name is the most reliable identifier of the exact face being used, because it bundles family and style into a single token. Two text runs may share FontFamilyName = Helvetica but differ here as Helvetica vs Helvetica-Bold vs Helvetica-Oblique.

Parameters

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

Remarks

Example

var
  I: Integer;
  Base: WString;
begin
  Pdf1.PageNumber := 1;
  for I := 0 to Pdf1.ObjectCount - 1 do
  begin
    Base := Pdf1.FontBaseName[I];
    if (Base <> '') and (Pos('Bold', Base) > 0) then
      Memo1.Lines.Add(Format('Object %d uses %s', [I, Base]));
  end;
end;

See Also

FontFamilyName, FontIsEmbedded, FontWeight, FontData, FontHandle