Re: Is this impossible?



Martin Rinehart wrote:
Googling this leads me to conclude that this simple design is
impossible to achieve.

I'd like a big button, 50 pixels tall and wide. In the center of the
button I'd like to say "Go", with the "G" about 25 pixels tall. On the
bottom right corner, in small letters, I'd like a "^G" to suggest that
you can use the keyboard, too.

I can do this on my machine, using my fonts and sizes. I'd like the
button to look about the same on your machine, using your fonts and
sizes. In Java I'd use FontMetrics to ask about the size of your text
and adjust accordingly. In JavaScript?

Just evicting this idea from my head - take from it what you want. Could you perhaps put a "G" by itself into a DIV and measure it's offsetHeight. You could rewrite the innerHTML of the DIV with different sizes and keep measuring, you'd eventually find out the height/width in pixels of a "G" in each size [and/or font].

If you're avoiding using an image for reasons of not wanting to impose a button style on different OSes, perhaps just the Go and the ^G could be GIFs with background transparency and you could have them in DIVs and overlay them onto an empty button.
.



Relevant Pages