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

 

对于嵌入的 Unicode fonts,HotPDF 现在会在字体变化时刷新 glyph state,从活动 Windows 字体解析 glyph IDs,并为生成的 PDF 写入匹配的 ToUnicode data。这改进了 Calibri 等嵌入字体的跨阅读器渲染

 

当前字体先用 RegisterUnicodeTTF 加载后,U+1F600 这类增补平面 Unicode 字符会通过字体的 cmap format 12 数据解析,并作为单个内部 CID 写入页面文本流。页面输出复用已注册的 Type 0 字体资源,因此定稿时会刷新与 AcroForm Unicode 外观流相同的 /CIDToGIDMap、后代字体 /W、/ToUnicode 和字体子集使用状态。

 

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

 

代码示例

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') );