PDA

View Full Version : Resizing Height & Width Of Fonts


Smoky
12-08-2004, 10:24 AM
Hey...

Can you by any chance change a height and width of a font with either PHP, CSS, Javascript or HTML?

I have a problem that my site resizes to the resolution to the client screen but at the moment i have to hard code the font sizes into PHP script. But this isnt good enough because i want my site to be able to resize to any resolution even the weird ones.

So is there a way i could create a ratio for the font size
Or can i set the height and width of a font?

Cheers for any help given
Mark :P

Tim
12-08-2004, 08:04 PM
I don't believe so. This kind of thing wouldn't be supported by a lot of web browsers, too...

mahangee
12-08-2004, 08:34 PM
I believe there is a way in CSS to do this, but this may not work entirely. And its rather simple. Although it might not work.

Try reading this http://www.w3.org/QA/Tips/font-size its about making font size relative rather than values in set values such as px. The idea behind it is, it will make the font smaller or larger compared to the viewers normal text size. It might/might not work.

Hope this helps :D

Smoky
12-09-2004, 01:20 PM
So if i used:
h1{ font: 80% sans-serif }

That would make the size of the text 80% of the normal font used?

Also is it possible to resize a image on the fly with PHP..?

I will know how big the resolution is and how big i want my table but i dont want to have to make 50 or more images for different resolutions to fit the table background.

Cheers
Mark

mahangee
12-09-2004, 04:00 PM
First of all I am not sure about percent but I know of this method,

H1 { font-size: 0.8em } Will make it 80% of the normal size.

And for your second question, I am not sure how to do this but I am sure you would be able to do . Sorry :D

Smoky
12-14-2004, 10:25 PM
Originally posted by mahangee@Dec 9 2004, 05:00 PM
First of all I am not sure about percent but I know of this method,

H1 { font-size: 0.8em } Will make it 80% of the normal size.

And for your second question, I am not sure how to do this but I am sure you would be able to do . Sorry :D
16567


Hey... :mellow:

I have found a way of making the text change size with a mathmatical ratio that works every time.

Basically i do my math and then write the size of the text into a css file... Easy..

Just thought id let you know that it is possible my way...

Also here is it: Langstone (http://smoky.hostmatrix.org/langstone/)