وثائق PDFiumVCL

FontData property

يحافظ إدخال API هذا على المعرّفات والتواقيع وكتل الكود ومصطلحات PDF بصيغتها الأصلية.
Component: TPdf  ·  Unit: PDFium
Read-only indexed access to the raw bytes of the embedded font program (only populated when the font is embedded).

Syntax

property FontData[FontIndex: Integer]: TBytes; // read only

Description

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.

Parameters

FontIndexIndex of the font handle. Obtain via FontHandle[CharIndex] or by enumerating the page font resources.

Remarks

Example

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;

See Also

FontSize, FontWeight, FontFamilyName, FontIsEmbedded, CharacterFontSize