True),还是仅被引用并在查看时由操作系统解析(False)property FontIsEmbedded[Index: Integer]: Boolean; // read only
FontIsEmbedded 报告给定索引处文本页面对象所引用的字体是否在 PDF 文件内部携带其实际字形程序。嵌入字体会随文档一起分发,并在任何平台上以相同方式渲染;非嵌入(仅引用)字体依赖查看器在本地找到同名字体,并可能在显示时被替换
索引器是基于 0 的页面对象索引(0..ObjectCount - 1)。非文本对象始终返回 False。读取该属性之前页面必须处于活动状态
嵌入可以是完整的(源字体的每个字形都存在)或子集的(仅出现实际使用的字形,并在基名前添加六字母前缀);两种形式在此处都算作嵌入。为了 PDF/A 合规,每个字体都必须嵌入 — 此属性是该要求的快速审计工具
| Index | 0..ObjectCount - 1 范围内的基于 0 的页面对象索引 |
True 并不说明嵌入是完整的还是子集的 — 检查 FontBaseName 是否有 ABCDEF+ 前缀来检测子集FontData 仅在字体已嵌入时返回数据Falsevar
I, EmbeddedCount, TextCount: Integer;
begin
Pdf1.PageNumber := 1;
EmbeddedCount := 0;
TextCount := 0;
for I := 0 to Pdf1.ObjectCount - 1 do
if Pdf1.ObjectType[I] = otText then
begin
Inc(TextCount);
if Pdf1.FontIsEmbedded[I] then Inc(EmbeddedCount);
end;
ShowMessage(Format('%d of %d text objects use embedded fonts',
[EmbeddedCount, TextCount]));
end;