Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to hide text if a font is unavailable?

Tags:

html

css

fonts

I'd like to write gracefully-degrading code that uses a Webdings glyph. Supposedly Webdings is one of those fonts that is universally available across platforms, but I don't want the browser to display the character in its default font if for some strange reason Webdings isn't there.

Is there any way to do this?

like image 650
Isaac Lubow Avatar asked Aug 22 '11 03:08

Isaac Lubow


1 Answers

As I said in a comment:

Instead of that, you should use @font-face to embed a fallback font. That's much better than hiding the text, and it works in "all browsers".

I prefer to use the Font Squirrel Generator to handle @font-face. It makes it very, very easy.

like image 160
thirtydot Avatar answered Nov 02 '22 05:11

thirtydot