Justtechjobs.com Find a programming school near you






Online Campus Both


php-windows | 2003032

[PHP-WIN] RE: Subject: Calculationg lines of text From: Neil Smith (neil <email protected>)
Date: 03/20/03

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 <email protected>>
>From: "Bobo Wieland" <dev <email protected>>
>To: <php-windows <email protected>>
>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

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php