FontOps.$wintextwidth()

Function group Execute on client Platform(s)
FontOps NO All

Syntax

FontOps.$wintextwidth(string,font-name|font-table-index,point-size[,font-style])

Description

Returns the width in screen units required to display the string using the specified window font.

You specify the font using either the font-name or font-table-index. When called with a font table index, $wintextwidth() uses the window font system table of the current library which can contain up to 15 fonts numbered 1 to 15. You can include a font-style constant, or combination of styles.

Example

Do FontOps.$wintextwidth('Hello WWW','Courier',36) Returns lWidth
; returns 243


Do FontOps.$wintextwidth('Hello WWW','Courier',36,kBold+kItalic) Returns lWidth
; returns 252


Do FontOps.$wintextwidth('Hello WWW',5,36) Returns lWidth
; returns 240
; note that System font is at position 5 in #WIWFONTS