开发者

Is there a way to show a font that is not supported by a browser?

开发者 https://www.devze.com 2023-03-16 19:36 出处:网络
I want to use a font called BPreplay and I\'m guessing it\'s not supported by at least one major browser, if not all of them.

I want to use a font called BPreplay and I'm guessing it's not supported by at least one major browser, if not all of them.

Is there a way using css or javascript/jquery or some other way to allow the browser to support and use the font on my website so that my users will see the font th开发者_运维问答at I want them too?

Thanks!


You can use @font-face property to use a custom font. Each browser needs a diferent type of font. You can read more here and find fonts compatible with all browsers here


Have you investigated Cufon or sIFR? Cufon is located at http://cufon.shoqolate.com/generate/ and sIFR is at http://wiki.novemberborn.net/sifr/

Both allow for you to serve up the font you want.


Have you looked at Google Web Fonts? http://www.google.com/webfonts


the @font-face css property allows you to specify a custom font by hosting it on your server and then specifying the url. You can implement it something like

@font-face {  
    font-family: 'BPrelay';  
    src: url('fontname.ttf');
}  

p { 
    font-family: BPrelay, helvetica, arial, sans-serif;
}  

You can also use services like Google web fonts or fontsquirrel to handle hosting and liscensing for you.

You can also provide a fallback to a local file if the user has it - to save on bandwidth


I find cufon a lot more elegant than @font-face - anti-aliasing is way crisper. Yeah, it's using javascript to control styling, which really should be left to css only, but hey, it works well, and most people couldn't give two stuffs about web standards

0

精彩评论

暂无评论...
验证码 换一张
取 消