Previous: TextHeight function To the Table of Content Next: TotalVbeMemory function

- 4.37.2.123 -
Standard Units
Graph Unit
Graph Unit Procedures and Functions

TextWidth function

Targets: MS-DOS, Win32


Graph Unit

Returns the width of a string in pixels.

Declaration:
function TextWidth(TextString: string): DWORD;
Remarks:
Takes the string length, current font size, and multiplication factor, and determines the width of TextString in pixels. This is useful for computing view-port widths, sizing a title to make it fit on a graph or in a box, and so on.

For example, with the 8x8 bit-mapped font (set by SetTextStyle), the string TMT is 24 pixels wide.

It is important to use TextWidth to compute the width of strings, instead of doing the computation manually. In that way, no source code modifications have to be made when different fonts are selected.


Previous: TextHeight function To the Table of Content Next: TotalVbeMemory function
TextHeight function Table of Content TotalVbeMemory function

- 4.37.2.123 -