PDFiumPas 文件

CharacterFontWeight 屬性

元件: TPdf  ·  單元: PDFium
以唯讀索引方式存取所用字型的 OS/2 usWeightClass 值(100 = Thin,400 = Regular,700 = Bold,900 = Black)

語法

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

說明

以索引方式唯讀存取所用字型的 OS/2 usWeightClass 值(100 = Thin,400 = Regular,700 = Bold,900 = Black)。有效範圍為目前頁面的 0 .. CharacterCount - 1;傳入超出範圍的索引會引發 EPdfError

字元會依其邏輯閱讀順序回傳,也就是 PDFium 剖析內容串流時的順序,不一定等同於視覺順序(由右至左的腳本可能會顯示成反向)

所有座標都採用 PDF 使用者空間點,原點在左下角。若要疊加到 VCL 畫布上,請使用 PdfView1.PointsToScreen 或你自己的座標轉換

參數

CharIndex目前頁面的零起始字元索引(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