Get Text Size

Top  Previous  Next

Returns the width and height that the specified text will occupy using the currently selected font. This escape sequence is useful for positioning text relative to other objects.

Parameter

Value or Description

Lead-In

<ESC>t

Sequence

The text to obtain coordinate information on

Terminator

null

 

Example

This positions text in the middle of the page

CAPTION="Whatever we want to print"

PRINT CHR$(27):"z";        ! get paper size

INPUT "";PX,PY

PRINT CHR$(27);"t";        ! get text size

PRINT CAPTION;CHR$(0);

INPUT "";TX,TY

PRINT CHR$(27);"=";        ! set position

PRINT STR(INT((PX/2) - (TX/2)));",0";CHR$(0);

PRINT CAPTION;