FUNCTION GetTextSize
* Determines the width in pixels of a given text string, based on
* a given font, font style and point size.
* Parameters: text string, font name, size in points, font style in
* format used by FONTMETRIC() (e.g. "B" for bold, "BI" for bold italic;
* defaults to normal).
LPARAMETERS tcString, tcFont, tnSize, tcStyle
LOCAL lnTextWidth, lnAvCharWidth
IF EMPTY(tcStyle)
tcStyle = ""
ENDIF
lnTextWidth = TXTWIDTH(tcString, tcFont, tnSize, tcStyle)
lnAvCharWidth = FONTMETRIC(6, tcFont, tnSize, tcStyle)
RETURN lnTextWidth * lnAvCharWidth
ENDFUNC