property FontDescent[Index: Integer; FontSize: Single]: Single; // solo lectura
FontDescent informa de la métrica de descenso de la fuente a la que hace referencia el objeto de página en el índice dado. El descenso es la distancia vertical, normalmente negativa en las métricas PDF, desde la línea base hasta el punto más bajo alcanzado por descendentes como las colas de 'g', 'p' o 'y'. El valor que devuelve PDFium ya está escalado al FontSize argument, in PDF user-space points.
The Index indexer is the 0-based page-object index (0..ObjectCount - 1). FontSize es el tamaño al que quieres que se calcule la métrica; pasa el tamaño al que pretendes renderizar o, cuando reproduzcas texto existente, el valor devuelto por CharacterFontSize Una página debe estar activa antes de leer la propiedad
Combined with FontAscent the descent gives the total line height of a font at a chosen size: LineHeight := FontAscent - FontDescent PDFium devuelve 0 cuando la fuente subyacente no expone la métrica (por ejemplo, ciertas fuentes Type3) o cuando el objeto de página no es texto
| Index | 0-based page-object index in the range 0..ObjectCount - 1. |
| FontSize | Font size in PDF points used to scale the metric (e.g. 12.0). Match it to the actual rendering size for a realistic descender value. |
Abs(FontDescent[...]) when you need the absolute drop below the baseline.FontSize on the line when sizing a row.var
I: Integer;
Asc, Dsc, LineHeight: Single;
begin
Pdf1.PageNumber := 1;
for I := 0 to Pdf1.ObjectCount - 1 do
begin
Asc := Pdf1.FontAscent[I, 12.0];
Dsc := Pdf1.FontDescent[I, 12.0];
LineHeight := Asc - Dsc;
if LineHeight > 0 then
Memo1.Lines.Add(Format('Object %d: line height = %.2f pt', [I, LineHeight]));
end;
end;