Is it possible to use custom fonts - using font-face?

扶醉桌前 提交于 2019-12-18 06:18:08

问题


I'm able to embed and style a font-face in a webpage to view on Android and iPhone, and it works fine. However, it will not render on Windows Phone 7.5.

I've tried embedding the font into the CSS:

@font-face {
    font-family:'MyFont';
    src: url(data:font/woff;charset=utf-8;base64,d09GR...
}

...and also provided eot / ttf files, using a declaration that works across all other browsers -

@font-face {font-family:'MyFont';src:url('../fonts/MyFont-webfont.eot');src:url('../fonts/MyFont-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/MyFont-webfont.svg#MyFontRegular') format('svg'), url('../fonts/MyFont-webfont.woff')format('woff'), url('../fonts/MyFont-webfont.ttf') format('truetype');font-weight:normal;font-style:normal;}

...but still no luck. I can't believe that the new Windows phones do not allow for font embedding, and only support a limited list of fonts, as mentioned in:

http://msdn.microsoft.com/en-us/library/hh202920%28v=vs.92%29.aspx

Even if it's a Javascript rendering solution, any insight / hints or tips would be great...there must be some kind of workaround!


回答1:


According to this blog post it's one of the "17 differences" between IE9 and IE9 on WP7.
And here's the MSDN article which officially confirms it.




回答2:


I was successful in using Cufón to display custom fonts on IE in WP 7.5. Typeface.js did NOT work.




回答3:


typeface.js works with it. Just tested it a few moments ago because I need to do the same thing. It uses canvas and vector drawings. http://typeface.neocracy.org/




回答4:


Whenever I need custom fonts I visit http://www.fontsquirrel.com/

It's an awesome site that lets you generate font-kits out of a .ttf file including a full CSS declaration with needed hacks for browser compatibility.

I don't know if it works on Win 7 Mobile, but I think it's worth a try



来源:https://stackoverflow.com/questions/8789295/is-it-possible-to-use-custom-fonts-using-font-face

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!