FPDF_FONT handle を返します。この handle により、component では wrapper されていない PDFium font API に advanced caller が直接アクセスできますproperty FontHandle[Index: Integer]: FPDF_FONT; // read only
FontHandle は、指定した index の text page object に対応する raw PDFium font pointer (FPDF_FONT) を返します。内部的には FPDFTextObj_GetFont が返す値そのもので、TPdf 上の他の Font* property である FontAscent, FontDescent, FontFamilyName, FontBaseName, FontIsEmbedded, FontItalicAngle, FontWeight, FontData はすべてその上にある convenience wrapper です
index は 0-based の page-object index で、範囲は 0..ObjectCount - 1 です。font を持つのは text object だけで、image, path, shading object ではこの呼び出しは nil を返します。property を読む前に page を active にしておく必要があります
返される handle は PDFium が所有し、現在 page が loaded の間だけ有効です。free したり、page 変更をまたいで保持したり、破壊的な PDFium API を向けたりしないでください。opaque な read-only token として扱ってください
| Index | 0-based page-object index. Use ObjectType first to confirm the object is text; non-text objects return nil. |
FPDFFont_* import に handle を渡す前には、必ず nil を確認してくださいFPDFFont_GetFlags や FPDFFont_GetFontBBox などですvar
I: Integer;
H: FPDF_FONT;
begin
Pdf1.PageNumber := 1;
for I := 0 to Pdf1.ObjectCount - 1 do
begin
H := Pdf1.FontHandle[I];
if H <> nil then
Memo1.Lines.Add(Format('Object %d uses font %s',
[I, Pdf1.FontFamilyName[I]]));
end;
end;