THPDFPage.GetWideTextWidth Method
Version 2.1102.0 adds ordinary native CFF2 text and portable CFF1 font embedding. Registered names select the frozen font bytes directly; cmap and hmtx supply glyphs and metrics, with per-font BMP/SMP mappings and a CIDFontType0C stream retaining all original glyph slots
Returns the width of a Unicode string rendered in the current font, in the page units of THotPDF.Resolution (1/Resolution inch), the same units as the drawing coordinates. Use it to align or wrap CJK, Cyrillic or surrogate-pair text
The width includes the current horizontal scaling, character spacing (SetCharacterSpacing, once per glyph) and word spacing (SetWordSpacing, once per space), so it matches the advance of the text as drawn
Declaration
function GetWideTextWidth(Text: WideString): Single;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
Text | Input used by GetWideTextWidth |
Return value
Returns the width in page units
Usage notes
- Use this API in the page drawing workflow before the affected page, resource, field, or catalog object is finalized
- Keep object names, field names, resource names, and returned handles stable until the document is finalized
- Page-level changes affect subsequent operators on the same page; save and restore graphics state when a temporary setting should not leak