ROFL

Im seriously considering your first option

After a long day of searching, im going with a VB solution,
system.drawing.graphics.measurestring() this will return the width and
height on a specified string

"give complete solutions, they help others" department:
-On the www this would be pretty moch useless as John stated, because
browsers, installed fonts etc are different & every browser allows you to
fixate your font. but im on a intranet :P
-as far as I know there is no component that will do this...

Thanks to all! (specially you john, my colleagues are still wondering why I
was on the floor)


-----Oorspronkelijk bericht-----
Van: John Vieth [mailto:[EMAIL PROTECTED] 
Verzonden: woensdag 29 september 2004 15:36
Aan: [EMAIL PROTECTED]
Onderwerp: RE: [ASP] Calculating the length of a string in pixels

Here's a poor man's (or simple man's) solution...

First display in a web page every character (numbers, letters, upper
case, lower case, etc) that might appear in your app.  Display the
characters using the exact same type properties, including font family,
size, weight, etc.  Make a screen capture of the page that displays
these characters.  Paste the screen capture into a Photoshop image and
zoom in on each character so that you can measure its width in pixels.
On paper or a text document, record the width in pixels that corresponds
with each character.  Once you've gathered all the data, create a
VBScript function for your ASP pages that computes the width of a
string.  The first thing the function must do is build a 2-dimensional
array to contain all the pairs of data--character and width.  Then the
function should parse through the string one character at a time, look
up each character in the array to find its width, and add the width to
an integer that represents the total width of the string.  The function
would then return the integer.



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~-> 

---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [EMAIL PROTECTED]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/active-server-pages/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to