PDFium Delphi Component Docs

CharacterFontWeight 属性

组件: TPdf  ·  单元: PDFium
对所用字体的 OS/2 usWeightClass 值的只读索引访问(100 = Thin,400 = Regular,700 = Bold,900 = Black)。

语法

property CharacterFontWeight[Index: Integer]: Integer; // read only

说明

对所用字体的 OS/2 usWeightClass 值进行只读索引访问(100 = Thin,400 = Regular,700 = Bold,900 = Black)。当前页面的有效范围是 0 .. CharacterCount - 1;传入超出范围的索引会抛出 EPdfError

字符按其逻辑阅读顺序返回 — 即 PDFium 解析内容流的顺序 — 而不一定是视觉顺序(从右到左的脚本可能显得颠倒)

参数

Index当前页面中基于 0 的字符索引(0 .. CharacterCount - 1)

备注

示例

var

  I: Integer;

begin

  for I := 0 to Pdf1.CharacterCount - 1 do

    if Pdf1.CharacterFontWeight[I] >= 700 then ShowMessage('bold');

end;

参见

CharacterCount, Charcode, CharacterRectangle, Character, TextPage