Please enable JavaScript to view this site.

 

int = TextNumLines(nBoxWidthInPixels,sSomeText,sFontName,nFontSizeTimes100,bIsBold)

 

This macro function estimates the number of lines occupied by sSomeText in a textbox of width nBoxWidthInPixels pixels, using sFontName. Supply the font size in hundredths of a point in nFontSizeTimes100 (for example, 1200 for 12 points). Set bIsBold to true for bold text, or false for regular text.

 

The font sFontName must be installed on the computer when this function is called.

 

The estimate uses Windows font measurements and simple wrapping at spaces and hyphens. A word that is too wide is split across lines. The result may differ from the layout produced by QuarkXPress or InDesign.

 

The markers &c and &s are treated as line breaks. An empty string returns 0. For non-empty text, the box width and font size must both be positive.

 

See also: StrLength, TextWidth.

 


Topic 174515, last updated on 16-Oct-2026