THPDFPage.UnicodeTextOut

THPDFPage

 

傳回頂部  上一頁  下一頁

Shows text represented by a Unicode string or buffer.

 

This procedure is retained for backward compatibility and shares the current TextOut font pipeline. Use it when existing code already passes WideString or UTF-16 buffers.

 

Delphi 語法:

procedure UnicodeTextOut( X, Y: Single; Angle: Extended; Text: PWORD; TextLength: Integer ); overload;

procedure UnicodeTextOut( X, Y: Single; Angle: Extended; Text: WideString ); overload;

 

描述:

This procedure prints a text line represented by a Unicode buffer ( Text: PWORD, TextLength: Integer ) or Unicode string ( Text: WideString ) from point X, Y using orientation Angle in degrees.

 

對 embedded Unicode fonts,HotPDF 現在會在 font 變更時重新整理 glyph state,從 active Windows font 解析 glyph IDs,並為產生的 PDF 寫入相符的 ToUnicode data。這會改善 Calibri 這類 embedded fonts 的 cross-viewer rendering

 

當 active font 已先透過 RegisterUnicodeTTF 載入時,U+1F600 這類 supplementary-plane Unicode characters 會透過 font 的 cmap format 12 data 解析,並在 page text stream 中輸出為單一 internal CID。Page output 會重用註冊的 Type 0 font resource,因此 finalization 會重新整理 AcroForm Unicode appearance streams 使用的同一組 /CIDToGIDMap、descendant font /W、/ToUnicode 與 font-subset usage stateRegisterUnicodeTTF 之後,U+1F600 之類補充平面的 Unicode 字元會透過字型的 cmap format 12 資料解析,並在頁面文字 stream 中輸出為單一內部 CID。頁面輸出重用已註冊的 Type 0 字型資源,因此收尾時會更新同一份 /CIDToGIDMap、子字型的 /W 與 /ToUnicode

 

Tests\Delphi\FontTest provides a practical comparison sample for TextOut and embedded font validation.

 

Code Example

HPDF.FontEmbedding := true;
HPDF.StandardFontEmulation := false;
HPDF.CurrentPage.SetFont( 'Arial Unicode MS', [], 12, 0, False );
HPDF.CurrentPage.UnicodeTextOut( 40, 100, 0, WideString('Unicode output sample') );