Docs de PDFiumPas

FontDescent Propiedad

Esta entrada API conserva identificadores, firmas, bloques de código y términos PDF en su forma original.
Componente: TPdf  ·  Unidad: PDFium
Devuelve el descenso de la fuente (la distancia desde la línea base hasta el descendente más bajo) de la fuente de un objeto de página, expresado en puntos PDF y escalado al tamaño de fuente proporcionado por el llamador

Sintaxis

property FontDescent[Index: Integer; FontSize: Single]: Single; // solo lectura

Descripción

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

Parámetros

Index0-based page-object index in the range 0..ObjectCount - 1.
FontSizeFont 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.

Notas

Ejemplo

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;

Véase también

FontAscent, FontSize, FontHandle, FontFamilyName