THPDFPage.SetTextRenderingMode

THPDFPage

 

Вверх  Назад  Далее

Determines text rendering mode.

 

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

 

Синтаксис Delphi:

procedure SetTextRenderingMode( Mode: TPDFTextRenderingMode );

 

C++ syntax:

void __fastcall SetTextRenderingMode ( TPDFTextRenderingMode Mode );

 

Description:

Determines whether showing text causes glyph outlines to be stroked, filled, used as a clipping boundary, or some combination of the three.

 

Code Example

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 rendering diagram

 

trStroke

 

Обводка текста

 

Stroke text rendering diagram

 

trFillThenStroke

 

Сначала заливка, затем обводка текста

 

Fill and stroke text rendering diagram

 

trInvisible

 

 

Ни заливка, ни обводка текста (невидимый текст)

 

 

 

trFillClipping

 

Заливка текста с добавлением в контур для clipping

 

Fill text and add to path rendering diagram

 

trStrokeClipping

 

Обводка текста с добавлением в контур для clipping

 

Stroke text and add to path rendering diagram

 

trFillStrokeClipping

 

Залить, затем обвести текст и добавить его в контур для clipping

 

Fill and stroke text rendering with path addition diagram

 

trClipping

 

Добавить текст в контур для clipping

 

Stroke text clipping rendering diagram