GetFontHasToUnicode

字体、内容提取

描述

报告选定字体是否具有 /ToUnicode CMap

语法

Delphi

Function TPDFlib.GetFontHasToUnicode: Integer;

返回值

0未选择字体,或者该字体没有 Unicode 映射
1该字体带有 /ToUnicode CMap

备注

没有 Unicode 映射的字体在文本提取时会丢失字符标识,并阻止转换为 PDF/A-*u 和 PDF/UA,因此在承诺可搜索或无障碍输出之前,清查过程应检查此标志。本库生成的字体始终会发出 CMap;加载的文档仅在其生成程序提供时才具有该映射。EnumDocumentFonts 通过 HasToUnicode 为每种字体公开相同信息,而 GetDocumentFontDiagnostics 则将缺少该映射的字体计入 NoToUnicodeCount

示例

PDF.SelectFont(FontID);
if PDF.GetFontHasToUnicode= 0 then
  ShowMessage('text extraction will not resolve this font');

另请参阅

EnumDocumentFonts、GetDocumentFontDiagnostics、GetFontIsEmbedded