PDFiumPas 文档

FontItalicAngle 属性

此 API 条目保留标识符、签名、代码块和 PDF 术语的原始形式。
组件: TPdf  ·  单元: PDFium
以度为单位的字体斜体角只读索引访问,常规斜体为负值,直立体为 0

语法

property FontItalicAngle[FontIndex: Integer]: Single; // read only

说明

返回字体的斜体角,单位为度,常规斜体通常为负值,直立体为 0。该属性使用从字符获得的字体句柄(FontHandle[CharIndex])或直接枚举页面字体资源得到的索引

只读。底层值由 PDFium 按需从字体字典或字体程序中查询。当索引不对应已知字体时,该函数会抛出 EPdfError

可与 CharacterFontSize / CharacterFontWeight 一起使用,用于驱动字体替换或文本样式重建流程

参数

FontIndex字体句柄索引,可通过 FontHandle[CharIndex] 或枚举页面字体资源获得

备注

示例

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;

另请参阅

FontSize, FontWeight, FontFamilyName, FontIsEmbedded, CharacterFontSize