property FontData[Index: Integer]: TBytes; // read only
Index の位置にあるテキストページオブジェクトの embedded font program の生バイトを返します(font が embedded のときだけ値が入ります)。現在ページのテキストオブジェクトに対する有効な範囲は 0 .. ObjectCount - 1 です
読み取り専用です。基底の値は PDFium が font dictionary または font program から遅延取得します。インデックスが既知の font に一致しない場合、この関数は EPdfError を発生させます
CharacterFontSize / CharacterFontWeight と組み合わせれば、フォント代替やテキストスタイル再構築のパイプラインを駆動できます
| Index | テキストオブジェクト(ObjectType[Index] = otText)を参照する 0 .. ObjectCount - 1 の 0 基点ページオブジェクトインデックスです |
FontData と TrueType/OpenType パーサーで font program を直接解析してください
var
I: Integer;
RawFont: TBytes;
begin
for I := 0 to Pdf1.ObjectCount - 1 do
if Pdf1.ObjectType[I] = otText then
begin
RawFont := Pdf1.FontData[I];
Memo1.Lines.Add(Format('%s (%d bytes)', [Pdf1.FontFamilyName[I], Length(RawFont)]));
end;
end;