Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextWidth in ASP 1

Status
Not open for further replies.

fischadler

Programmer
May 31, 2002
258
MT
If you know the font name and font size, and you know whether the text is in bold, italics or underlined, would it be possible determine the length in pixels of a string of text? It would be very easy to calulate that if the font is mono spaced, but what about other standard fonts such as Arial?

There is a function in Visual Basic called TextWidth, that does exactly that. Is there an equivalent in ASP?

Thanks!

-Fischadler
 
You could make some logic to guess but it would never be more than a guess because the web server never really knows how the browser will display something...

With Internet Explorer, for example, you can click the menu View -> TextSize -> Largest.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top