HighTechTalks DotNet Forums  

how to get a width of a character in verdana

Dotnet Scripting microsoft.public.dotnet.scripting


Discuss how to get a width of a character in verdana in the Dotnet Scripting forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
arunapai0603
 
Posts: n/a

Default how to get a width of a character in verdana - 12-19-2005 , 06:35 AM







can anybody plz help me...

i wanna know how can i get width of a character.in a column i can ente
maximum of 255 characters.
in verdana style...,only the letter "m" is creating a problem.
due to letter m, the alignment of the column is distorted.
plz reply as soon as possible...

--
arunapai060



Reply With Quote
  #2  
Old   
Mythran
 
Posts: n/a

Default Re: how to get a width of a character in verdana - 12-19-2005 , 11:24 AM







"arunapai0603" <arunapai0603.20ad1y (AT) no-mx (DOT) forums.yourdomain.com.au> wrote in
message news:arunapai0603.20ad1y (AT) no-mx (DOT) forums.yourdomain.com.au...
Quote:
can anybody plz help me...

i wanna know how can i get width of a character.in a column i can enter
maximum of 255 characters.
in verdana style...,only the letter "m" is creating a problem.
due to letter m, the alignment of the column is distorted.
plz reply as soon as possible....


--
arunapai0603


AFAIK, you can't with pure script. But since you have posted to the dotnet
scripting, you *should* come close if all end-users are have Verdana (which
should be installed) on their local machine and haven't changed any other
font settings on the browser(s) they are using. You can *guess* the font
size by creating a .Net DLL and use the Graphics.MeasureString method. Of
course, this would have to be done client-side (due to different
settings/hardware on server than on client).

If you tested writing a server-side solution using MeasureString, and ran it
on your client (while your server/client while developing are the same
solution), you would get a false-positive because your server-settings are
the same as your client-settings because they are the same computer.

Anywho, just a way to do it...I don't recommend it...but it's a way :P

HTH,
Mythran



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.