Re: Pixel Length of text message

From: Date: Mon, 29 Apr 2002 16:51:16 +0000
Subject: Re: Pixel Length of text message
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-95198@lists.php.net to get a copy of this message
Just my $0.02, but it's generally a bad idea to use fixed pixel size fonts. Some people need to be able to enlarge and decrease the font size within the browser, and this will not allow them to do it. Maybe if you explain what you're trying to accomplish, somone here can help you out a little more. ---John Holmes... ----- Original Message ----- From: "Jason Wong" <php-general@gremlins.com.hk> To: <php-general@lists.php.net> Sent: Monday, April 29, 2002 12:31 PM Subject: Re: [PHP] Pixel Length of text message > On Tuesday 30 April 2002 00:17, District Webmaster wrote: > > In html/css you can set a font size in pixels -- in my experience this > > means a letter takes the same number of pixels, regardless of > > resolution. > > That may (or may not) be true, but that's referring to the height of the font. > > > With php, can I use string length and font pixel size to > > determine the length of a given string on a screen? Does anyone know an > > algorithm for this that works for any/every font? > > Here I would assume you're referring to the width of the text. Thus what you > want to do is not possible. > > You can use a fixed-width font and hope for the best. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > If the very old will remember, the very young will listen. > -- Chief Dan George > */ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#95198) next »