THPDFPage.SetTextRenderingMode

THPDFPage

 

Arriba  Anterior  Siguiente

Determines text rendering mode.

 

TPDFTextRenderingMode = (trFill, trStroke, trFillThenStroke, trInvisible, trFillClipping, trStrokeClipping, trFillStrokeClipping, trClipping);

 

Sintaxis Delphi:

procedure SetTextRenderingMode( Mode: TPDFTextRenderingMode );

 

Sintaxis C++:

void __fastcall SetTextRenderingMode ( TPDFTextRenderingMode Mode );

 

Descripción:

Determina si al mostrar texto los contornos de los glifos se trazan, se rellenan, se usan como límite de recorte o alguna combinación de las tres opciones.

 

Ejemplo de código

program TextRender;
{$APPTYPE CONSOLE}
uses
    SysUtils, Graphics, Classes, HPDFDoc;
var
    HPDF: THotPDF;
begin
    HPDF := THotPDF.Create(nil);
    try
        HPDF.AutoLaunch := true;                                      // PDF file will be shown automatically
        HPDF.FileName := '.\TextRender.pdf';                          // Set PDF filename
        HPDF.BeginDoc;                                                // Create PDF file

        HPDF.CurrentPage.SetRGBStrokeColor( clRed );                  // Set stroke color
        HPDF.CurrentPage.SetRGBFillColor( clYellow );                 // Set fill color
        HPDF.CurrentPage.SetTextRenderingMode( trFillThenStroke );    // Set fill and stroke rendering mode
        HPDF.CurrentPage.TextOut( 10, 10, 0, 'Fill and stroke text'); // Print text
        HPDF.EndDoc;                                                  // Close PDF file
    finally
        HPDF.Free;
    end;
end.

 

Value                Meaning


 

trFill

 

Fill text.

 

Fill text rendering diagram

 

trStroke

 

Texto con trazo

 

Stroke text rendering diagram

 

trFillThenStroke

 

Rellenar y luego trazar el texto

 

Fill and stroke text rendering diagram

 

trInvisible

 

 

Ni relleno ni trazo de texto (invisible)

 

 

 

trFillClipping

 

Rellena el texto y lo agrega a la ruta para recorte.

 

Fill text and add to path rendering diagram

 

trStrokeClipping

 

Traza el texto y lo agrega a la ruta para recorte.

 

Stroke text and add to path rendering diagram

 

trFillStrokeClipping

 

Rellena, luego traza el texto y lo agrega a la ruta para recorte

 

Fill and stroke text rendering with path addition diagram

 

trClipping

 

Agrega el texto a la ruta para recorte.

 

Stroke text clipping rendering diagram