property FontWeight[Index: Integer]: Integer; // solo lectura
FontWeight informa de la clase de peso de la fuente a la que hace referencia el objeto de página en el índice dado, siguiendo la convención CSS / OpenType: 100 (Thin) hasta 900 (Black), con 400 = Regular y 700 = Bold. Se deriva del descriptor de fuente incrustado o, para fuentes no incrustadas, de la tabla de sustitución de PDFium
The index is the 0-based page object index, valid from 0 to ObjectCount - 1. Only text objects carry a meaningful weight; querying a non-text object returns 0. For weights tied to individual extracted characters (rather than to a page object's font dictionary) use CharacterFontWeight.
A page must be active (PageNumber already set). The weight is decoded from the font handle obtained via FontHandle; si la propia fuente no declara un peso, PDFium devuelve 0 y la propiedad hace lo mismo
| Index | 0-based page-object index, in the range 0..ObjectCount - 1. Only text objects produce a non-zero weight. |
var
I, BoldCount: Integer;
begin
Pdf1.PageNumber := 1;
BoldCount := 0;
for I := 0 to Pdf1.ObjectCount - 1 do
if Pdf1.FontWeight[I] >= 600 then
Inc(BoldCount);
ShowMessage(IntToStr(BoldCount) + ' bold text objects on page 1');
end;