Log in

View Full Version : Different CSS for different fonts?



Ilana
07-04-2007, 01:54 AM
Hi -

I have been searching for the answer to this question and haven't come across a suitable solution....

I would like to use the new Microsoft font Calibri (which comes standard with Office 2007 and Windows Vista). However if people haven't upgraded I would like them to see Trebuchet.

The issue is that these two fonts display as quite different sizes. What looks like a 10 point font in one is a 13 point in the other. This makes the difference between the content being readable and indiscernable.

Is there any way that I can use CSS to specify that if the reader is seeing Calibri it shows as one font size and if Trebuchet it shows as another font size?

Thanks a million!!

Twey
07-04-2007, 11:36 AM
It sounds as if Calibri is another of those fonts (like Verdana) that should be avoided entirely for web development because it is proportionally bigger than other fonts.

Using point sizes for onscreen fonts is a bad idea anyway, however. Points are a real-world measurement, and the actual size relative to the display will vary.

spoonman
07-04-2007, 12:16 PM
I don't think this is going to be possible purely in CSS, using php this is quite easy as you would just have to detect whether Calibri is installed.

Twey
07-04-2007, 02:34 PM
... which is impossible.

Ilana
07-05-2007, 03:10 AM
Not the answer I hoped for... but thanks for the help!

techno_race
07-07-2007, 05:02 PM
Erm...


font-face: "Calibri","Trebuchet MS";

techno_race
07-07-2007, 05:03 PM
Oh, sorry, I didn't read your whole post. That is impossible.

Twey
07-07-2007, 08:57 PM
And all fonts specified with font-family should have a generic font... er... family... as a last resort.