property FontData[FontIndex: Integer]: TBytes; // read only
傳回內嵌字型程式的原始位元組(僅在字型已內嵌時有內容)。此屬性以從字元取得的字型處理常式(FontHandle[CharIndex])為索引,或可直接透過頁面的字型資源枚舉取得
唯讀。底層值會由 PDFium 以延遲方式從字型字典或字型程式查詢。當索引不對應任何已知字型時,函式會拋出 EPdfError
可將此屬性與 CharacterFontSize / CharacterFontWeight 一起使用,以驅動字型替換或文字樣式重建流程
| FontIndex | 字型處理常式的索引。可透過 FontHandle[CharIndex] 或枚舉頁面字型資源取得 |
FontData 與 TrueType/OpenType 剖析器直接查詢字型程式
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;