getTextWidth()

eSignal EFS 2

getTextWidth()

Top  Previous  Next

 

getTextWidth( text [, fontName] [, fontSize] )

 

Returns the width of text in pixels.

 

Parameters

 

text

the string to evaluate

fontName

optional. the name of the font to use

fontSize

optional. the font size to use

 

Usage

 

function main() {

var myVar;

 

       ...

       ...

 

       //return the width, in pixels, of the string

       //"Test Results" in a 24-point Arial font.

       myVar = getTextWidth( "Test Results", "Arial", 24 );

 

 

}

 

getTextHeight()