不同操作系统上的嵌入字体问题
我的 Flex 网页在主 css 文件中使用嵌入的 .otf 字体:
@font-face {
src:url("../assets/fonts/TradeGothic.otf");
fontFamily: myTradeGothic;
}
我使用 Snow Leopard 进行开发,该字体在 Safari、Firefox 和 Chrome 中显示良好。当我在 Windows 计算机上查看该页面时,该字体似乎在 IE 或 Firefox 中都不起作用,但默认为不同的字体,从而消除了所有间距。有什么想法吗?
My Flex web page is using an embedded .otf font in the main css file:
@font-face {
src:url("../assets/fonts/TradeGothic.otf");
fontFamily: myTradeGothic;
}
I develop using Snow Leopard and the font appears fine in Safari, Firefox, and Chrome. When I view the page on a Windows machine, the font does not appear to be working in either IE or Firefox, but has defaulted to a different font which throws off all the spacing. Any ideas why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
测试字体时应该做的第一件事就是从系统中卸载它们并确保它们正确呈现。它们很可能只能在您的 Mac 上正确呈现,因为该字体已安装在您的系统中。
话虽这么说...据我所知,您无法在运行时加载常规字体文件并使其工作。您需要将字体编译为 swf 并在运行时将该 swf 加载到您的应用程序中以访问该字体。这也是 sifr 的方式 ( http://www.mikeindustries.com/blog/sifr )作品。
The first thing you should do when you're testing fonts is uninstall them from your system and make sure they render correctly. Chances are they're only rendering correctly on your mac because the font is installed in your syste,.
That being said... As far as i know you cant load a regular font file at runtime and have it work. You need to compile the font into a swf and load that swf at runtime into your app to access the font. That's also the way sifr ( http://www.mikeindustries.com/blog/sifr ) works.