THPDFPage.SetTextRenderingMode

THPDFPage

 

傳回頂部  上一頁  下一頁

Determines text rendering mode.

 

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

 

Delphi 語法:

procedure SetTextRenderingMode( Mode: TPDFTextRenderingMode );

 

C++ 語法:

void __fastcall SetTextRenderingMode ( TPDFTextRenderingMode Mode );

 

描述:

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.

 

數值意義


 

trFill

 

填滿文字

 

Fill text rendering diagram

 

trStroke

 

描邊文字

 

Stroke text rendering diagram

 

trFillThenStroke

 

先填滿文字,再 stroke text,並將文字加入 path 供 clipping 使用

 

Fill and stroke text rendering diagram

 

trInvisible

 

 

既不填滿也不描邊文字(不可見)

 

 

 

trFillClipping

 

填滿文字,並加入裁剪路徑

 

Fill text and add to path rendering diagram

 

trStrokeClipping

 

描邊文字,並加入裁剪路徑

 

Stroke text and add to path rendering diagram

 

trFillStrokeClipping

 

先填滿文字,再描邊文字,並將文字加入 path 供 clipping 使用

 

Fill and stroke text rendering with path addition diagram

 

trClipping

 

將文字加入裁剪路徑

 

Stroke text clipping rendering diagram