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 syntax:

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

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

 

Description:

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 теперь обновляет glyph state при смене шрифта, разрешает glyph IDs из active Windows font и записывает matching ToUnicode data для generated PDF. Это улучшает cross-viewer rendering для embedded fonts, таких как Calibri

 

Когда active font сначала загружен через RegisterUnicodeTTF, supplementary-plane Unicode characters, такие как U+1F600, разрешаются через cmap format 12 шрифта и выводятся как один internal CID в page text stream. Page output повторно использует registered Type 0 font resource, поэтому finalization обновляет те же /CIDToGIDMap, descendant font /W, /ToUnicode и font-subset usage state

 

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