anony_root
anony_root

Reputation: 1527

Can I make font-weight:bold if user has a special font?

I have a text with font-family: "Lucida Grande", tahoma, arial, sans-serif;

Lucida Grande looks good with font-weight: bold, but tahoma isn't and vice versa: tahoma looks good with normal font-weight, but Lucida Grande isn't.

Upvotes: 0

Views: 561

Answers (2)

deathlock
deathlock

Reputation: 2837

RemySharp's font.js could be useful. :)

Using jQuery, basically it checks whether the mentioned font exists or not. In your case then, if Lucida Grande exists, you could bold it with $('.yourelement').css('font-weight, bold');

Upvotes: 0

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201798

No, there is no way to make font weight depend on font family.

Normally, the value of the font-family property should be a list of similar fonts so that any of them matches the overall design. Lucida Grande is rather different from Tahoma and Arial, which are rather different from each other. Better alternatives to it are Lucida Sans and Lucida Sans Unicode. Don’t forget to test the appearance using each of the fonts you list down, instead of just copying font family lists from somewhere.

This may remove the need for alternating between normal and bold—any such need is probably a consequence of incompatible font choices.

Upvotes: 2

Related Questions