Hey folks,
Just wondering if there is a quick way of measuring/estimating the width of a particular piece of text that's in an element with undefined width - for example 'Plain text version' for use in a button, as currently I'm having to make repeated adjustments to background buttons to get it right which takes a lot of time. Can you just take the font size and multiply it by the number of characters? Not tried that as I only just thought of it.
Any thoughts on this appreciated.
Cheers
Page 1 of 1
Measuring text element widths Is there a quick way?
#2
Posted 06 November 2008 - 03:55 PM
Quote
Can you just take the font size and multiply it by the number of characters?
No. Different fonts are different widths (pixel wise), and are not consistent widths among font sets, unless one is using true-type fonts. Even then, there is no guarantee that it will work out like you want. The only suggestion that I have is to use an IDE in which you can create the buttons and actually see the buttons as you are creating them, as opposed to resizing, then running the code, cussing, resizing the button, running the code, cussing, etc.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens
#3
Posted 07 November 2008 - 11:06 AM
Thanks for that groovicus,
I figured it couldn't be straightforward but that's definitely worth knowing. I've actually got what I think is an awesome IDE type thing (was bought a copy of CS3 master collection) but I'm nowhere near getting my head round it yet. I'll stick with the rinse-repeat cycle til I've read the manuals, at least it works.....eventually.
I figured it couldn't be straightforward but that's definitely worth knowing. I've actually got what I think is an awesome IDE type thing (was bought a copy of CS3 master collection) but I'm nowhere near getting my head round it yet. I'll stick with the rinse-repeat cycle til I've read the manuals, at least it works.....eventually.
Share this topic:
Page 1 of 1

Help


Back to top









