THPDFPage.GetWideCharAdvances Method
Measures a Unicode string in the current font: TotalWidth picks up its width and Advances the advance of each character, in the page units of THotPDF.Resolution (1/Resolution inch) - the same units as the drawing coordinates
Declaration
function GetWideCharAdvances(const Text: WideString; out TotalWidth: Single; out Advances: array of Single): boolean;
Unit
HPDFDoc
Parameters
| Name | Description |
|---|---|
Text | The Unicode text to measure |
TotalWidth | [out] Total width of the whole line, in user-space points |
Advances | [out] Array of natural per-glyph advances (kerning included, in user-space points, the same unit as GetWideTextWidth); call SetLength to Length(Text) beforehand |
Return value
Gives True when the text could be measured
Usage notes
- Use this API in the page drawing workflow before the affected page, resource, field or catalogue object is finalised
- Keep object names, field names, resource names and returned handles stable until the document is finalised
- Page-level changes affect subsequent operators on the same page; save and restore graphics state when a temporary setting should not leak