473,387 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Text offsetWidth server-side

Hi all!
I was just wondering if there is a way in PHP to estimate the offSetWidth a text element will have when rendered.
Nothing too accurate, maybe a function that receives a font, font size, and some text and can estimate the size in pixels the word would have client-side.
Mar 30 '07 #1
0 1109

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Geoff Soper | last post by:
Does anyone know of a way of neatly truncate a line of text at a given physical point, i.e. a width specified in pixels. By neatly I mean not by simply using the overflow CSS property but to...
3
by: Steven Van Impe | last post by:
Hi, I'm trying to create a style for boxed images with a caption that wraps beneath them. You'll notice on <http://users.skynet.be/vanimpe/WGRA/geschiedenis.html> that the text below the image...
6
by: jawolter | last post by:
I have a list of links that are sometimes too long to display on a given screen. I want to trim the ends of them if they are too long, and show dot dot dot. If the browser is widened, though, and...
4
by: jawolter | last post by:
I have text that is too long to nicely fit on a given page, so I want to add ellipses to the end that dynamicaly resize based on the person resizing the page width. If you hover it would show the...
4
by: Andrew Poulos | last post by:
Is there a way to know the overall width of a piece of text? Not the width of, say, a single line P tag but any words it may contain. I've been given a problem where text that is dynamically...
1
by: Beni Rose | last post by:
I'm trying to build some dynamic vertical drop down menus (pop out menus?) and I'm having some trouble. I'm trying to get the width of the span tag that the root level menu item is in, because it's...
1
by: Hendri Adriaens | last post by:
Hi, I have an onmouseover script that displays a div with some comment. There are several links getting this onmouseover functionality, all with their own comment text. Now I want the div to...
5
by: liketofindoutwhy | last post by:
for the code var node = document.getElementById("something") alert(node.offsetWidth) is very similar to node.clientWidth and node.scrollWidth I just wonder why offsetWidth is well...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.