RE: Subject: Calculationg lines of text
| From: | Neil Smith | Date: | Thu, 20 Mar 2003 17:20:41 +0000 |
| Subject: | RE: Subject: Calculationg lines of text | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19071@lists.php.net to get a copy of this message | ||
Not really Bobo, since anybody can open their browser window in various sizes, number of pixels per inch of screen varies, fonts have differing character widths and so on. Javascript isnt much help here.
You can possibly have some default hidden text in a div and measure the clientWidth or offsetWidth CSS property of it using javascript, but its no practical use in predicting the width of the text you *want* to show.
The only way I can think of is to use fixed width fonts (ugh!) like system fonts defaultly used inside <PRE> or <TEXTAREA> tags. Of course, users can specify their own stylesheet overriding anything you might choose to use. Unlucky !
So, IMO I would have to say no. Bet plan is to make a good guess and keep your fingers crossed.
Any particular reason you might want to do this ? The trend with the web in any case is to go for fluid layout for different browser types, platforms and even devices (iPaq, mobile browsers, CE machines), and so its probably justified.
HTH
Neil Smith.
At 08:13 20/03/2003 +0000, you wrote:
---------------------------------------------------------------------- Message-ID: <000201c2ee6e$f7bb0f80$14f21e0a@elstudion> From: "Bobo Wieland" <dev@elstudion.com> To: <php-windows@lists.php.net> Date: Wed, 19 Mar 2003 22:29:22 +0100 MIME-Version: 1.0 Content-Type: text/plain;charset="Windows-1252"Content-Transfer-Encoding: 7bit Subject: Calculationg lines of text When you're dealing with layout w text and images in documents on the web, where the text/images is updatable by the client, it would be nice to be able to calulate lines of text and charachters per line. Is there some way to do this in php? If not, is it possible in some other language? Javascript, maybe? .bobo