THPDFPage.SetTextRenderingMode

THPDFPage

 

ด้านบน  ก่อนหน้า  ถัดไป

กำหนดโหมดการเรนเดอร์ข้อความ

 

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

 

Delphi syntax:

procedure SetTextRenderingMode( Mode: TPDFTextRenderingMode );

 

C++ syntax:

void __fastcall SetTextRenderingMode ( TPDFTextRenderingMode Mode );

 

คำอธิบาย:

กำหนดว่าการแสดงข้อความจะส่งผลให้เส้นขอบกลีฟถูกลากเส้น เติมสี ใช้เป็นขอบเขตการตัด หรือเป็นการผสมผสานระหว่างสามสิ่งนี้

 

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

 

เติมสีข้อความและเพิ่มลงในเส้นทางสำหรับตัดขอบ

 

Fill text and add to path rendering diagram

 

trStrokeClipping

 

ลากเส้นข้อความและเพิ่มลงในเส้นทางสำหรับตัดขอบ

 

Stroke text and add to path rendering diagram

 

trFillStrokeClipping

 

เติมสี จากนั้นลากเส้นข้อความและเพิ่มลงในเส้นทางสำหรับตัดขอบ

 

Fill and stroke text rendering with path addition diagram

 

trClipping

 

เพิ่มข้อความไปยังเส้นทางสำหรับตัดขอบ

 

Stroke text clipping rendering diagram