THPDFPage.TextWidth

THPDFPage

 

Top  Previous  Next

Gives the width of a string drawn in the current font, in the page units of THotPDF.Resolution (1/Resolution inch) - the same units as the drawing coordinates

 

Delphi syntax:

function TextWidth ( const Text: AnsiString ): Single;

 

C++ syntax:

float __fastcall TextWidth ( AnsiString Text );

 

Description:

 

Use TextWidth to determine the length. TextWidth indicates whether a given string will fit in the available space. Other graphical elements such as lines, or additional strings can be positioned to accommodate the width of the text

 

The width takes in the current horizontal scaling, character spacing (SetCharacterSpacing, once per glyph) and word spacing (SetWordSpacing, once per space, a trailing space included), so it matches the advance of the text as drawn