> In any case, I usually avoid having to go to a COM component > unless I absolutely HAVE to.
You're like me. I was never interested in learning VB. Seemed like a wasted investment since, for classic ASP development, it's so rare for me to want a custom VB component and, if I do, I'm usually better served with commercially-available components. And I always figured that, if I *have* to learn a full-scale programming language and IDE, I'd rather invest that time in Java. I've changed my tune a bit since .NET arrived. I love the C# language. It's very powerful, and I don't have to listen to Java programmers call my language a toy or a language for learning, beginners, or non-programmers. And the .NET Framework is very powerful. And if you know JavaScript (really know it, not just cutting and pasting scripts), then C# will come very easily. It's all so easy and so powerful that I couldn't afford *not* to learn/use it. Now I don't hesitate to use .NET assemblies and classes (.NET equivalent to VB components), and not because it can do things that ASP.NET can't (like VB components can do things ASP can't), but because it makes more sense from the standpoint of code reuse, organization, and encapsulation. I highly recommend it. - JV > -----Original Message----- > From: Mat�as Ni�o ListMail [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 29, 2004 11:05 AM > To: [EMAIL PROTECTED] > Subject: RE: [ASP] Calculating the length of a string in pixels > > I like John's solution! It's simple, doesn't require messy > dll server registration, and will definitely work fine on > standard browsers that display fonts as specified by the > font-size style in pixels. And you can pretty much reuse it > as an include whenever you like. > > The only situation that I know it might fail in, is with > Firefox's font zooming cause I know Firefox lets you > increase/decrease font sizes even with a specified pixel > size. IE doesn't. > > In any case, I usually avoid having to go to a COM component > unless I absolutely HAVE to. > > -Matias > > > > -----Original Message----- > From: Niels Bieze [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 29, 2004 10:12 AM > To: [EMAIL PROTECTED] > Subject: RE: [ASP] Calculating the length of a string in pixels > > 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 > > > > > > > > ------------------------ Yahoo! Groups Sponsor > --------------------~--> Make a clean sweep of pop-up ads. > Yahoo! Companion Toolbar. > Now with Pop-Up Blocker. Get it for free! > http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/17folB/TM > -------------------------------------------------------------- > ------~-> > > -------------------------------------------------------------- > ------- > Home : http://groups.yahoo.com/group/active-server-pages > --------------------------------------------------------------------- > Post : [EMAIL PROTECTED] > Subscribe : [EMAIL PROTECTED] > Unsubscribe: [EMAIL PROTECTED] > --------------------------------------------------------------------- > Yahoo! Groups Links > > > > > > > > ------------------------ 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/
