Forum Moderators: not2easy

Message Too Old, No Replies

Font selection based on font type.

Can you nest font sizes by font type?

         

rscott7706

3:39 am on Mar 24, 2009 (gmt 0)

10+ Year Member



I pro-bono have a site where the organization wants Brush Script MT for one of the menus.

Since it takes a fairly large font-size to render properly, I wonder if I can nest some font calls, with their font size requirement.

I don't think I can use font-family, but maybe font size (although I haven't had any luck so far).

i.e.

font-size: Brush Script MT 18px, Arial 12px, Verdana 12px;
(which does not work)

Any suggestions - or am I out of luck?

Thanks

Ron

CSS_Kidd

1:56 pm on Mar 24, 2009 (gmt 0)

10+ Year Member



First the Font name should not be included with the font-size. You need to create a rule for each font.

swa66

2:15 pm on Mar 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



CSS3 will have a property font-size adjust.
[w3.org...]

I think it'll do what you seek to have.

For now I don't know of implementations of this yet, so you might need to resort to javascript or so to get it done if you need it.

There is a generic "fantasy" font that browsers should define already.
And hence you might try to load up your font-family with a number of script fonts that all need a larger size to be readable, to improve the odds that one of the fonts is actually available.

I'd try something like
font-family: "Brush Script MT" Mistral "Comic Sans MS" "Marker Felt"
"Edwardian Script ITC" "Lucida Handwriting" fantasy;
font-size: 18px;

(quite a few above come along with Microsoft Office)

rscott7706

4:32 pm on Mar 24, 2009 (gmt 0)

10+ Year Member



Thanks swa66!

This seems to be a credible solution for most cases. I have recently realized the benefits of CSS - and its simplistic yet effective approach.

I would think this issue should be able to be addressed through CSS only, I avoid javascript like the plague.

Ron

swa66

9:46 pm on Mar 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just saw that I have a syntax error above, sorry about that, I should have written (note the commas):

font-family: "Brush Script MT", Mistral, "Comic Sans MS", "Marker Felt",
"Edwardian Script ITC", "Lucida Handwriting", fantasy;
font-size: 18px;

rscott7706

12:30 am on Mar 25, 2009 (gmt 0)

10+ Year Member



Thanks swa66 - I had caught it, but your basic idea was the motivator - good work!

I already have it running and it helped so much with the situation.

Ron