PDFium Component Docs

FontData プロパティ

この API エントリでは識別子、シグネチャ、コードブロック、PDF 用語を元の表記のまま保持します。
コンポーネント: TPdf  ·  ユニット: PDFium
embedded font program の raw byte への read-only indexed access です。font が embedded のときだけ値が入ります

構文

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

説明

embedded font program の raw byte を返します。font が embedded のときだけ値が入ります。property は character から得た font handle (FontHandle[CharIndex]) か、page の font resource を直接列挙したものを index にします

read-only です。基盤の value は PDFium が font dictionary または font program から遅延取得します。index が既知の font と一致しない場合、この function は EPdfError を送出します

CharacterFontSize / CharacterFontWeight と組み合わせると、font-substitution や text-style reconstruction pipeline に使えます

パラメータ

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

備考

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;

関連項目

FontSize, FontWeight, FontFamilyName, FontIsEmbedded, CharacterFontSize