You are here: Checking for text overflow (in PHP?) « PHP Language « IT news, forums, messages
Checking for text overflow (in PHP?)

Posted by Anze on 01/05/08 17:38

Hi!

I hope someone can help me out with this... I know the majority will
think "it can't be done", but let's suppose it _must_ be done - how could
it be done?

I am working on a form to compose text banners. The space for text is
(obviously) limited, the font is preset (assuming visitor doesn't change
the font size / face). What I would like is for PHP to have a way of
determining if the text fits into the space... The text is entered throught
XML (so no client checking is possible, everything must be done
server-side).

I could limit the number of characters, but some banners are not very wide
and the wrapping can make a huge difference in space consumed.

I know the solutions are probably too complicated / impossible to work on,
but still... I would appreciate any ideas how it _could_ be done if it
_must_ be done.

Is there some way PHP can access some Firefox engine to draw the banner and
figure out with JS if the banner text is too long? I would rather see if
the server was Linux, but it is not necessary... (I remember reading about
some PHP testing library using calls to IE?)

I also know that due to the very nature of HTML the same banner won't look
alike in IE, FF, Safari, Opera, Galeon, Konqueror, Lynx,... But let's
suppose that I want at least one referential browser where it looks OK (IE
or FF). And I know this is a total overkill, but - well, I'm curious how it
could be done. :)

I would appreciate any ideas,

Anze

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация