波斯语 @font-face 在 Chrome 中不起作用,是否存在错误? [英] Persian @font-face doesn't work in Chrome, Bug or not?

查看:35
本文介绍了波斯语 @font-face 在 Chrome 中不起作用,是否存在错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不确定我是在处理 Chrome 中的错误还是我的 CSS 有问题

这是我所谈论内容的演示:演示链接

问题是我在我的网站中使用了一种自定义的波斯语字体,名为 BMitra(它在公共领域完全免费)和所有主要浏览器(最新FF 和 IE6+) 呈现这种字体就好了,但我的 Chrome 跳过了这种字体并切换到系统默认的 tahoma.

这是我的 CSS:

@font-face {字体系列:'BMitra';字体粗细:正常;src: url('fonts/regular/BMitra.eot?#iefix') format('embedded-opentype'),/* IE6-IE8 */url('fonts/regular/BMitra.woff') format('woff'),/* 现代浏览器 */url('fonts/regular/BMitra.ttf') 格式('truetype'),/* Safari, Android, iOS */url('fonts/regular/BMitra.svg#svgBMitra') 格式('svg');/* 旧版 iOS */}@字体脸{字体系列:'BMitra';字体粗细:粗体;src: url('fonts/bold/BMitraBd.woff') format('woff'),/* 现代浏览器 */url('fonts/bold/BMitraBd.eot?#iefix') 格式('embedded-opentype'),/* IE6-IE8 */url('fonts/bold/BMitraBd.ttf') 格式('truetype'),/* Safari, Android, iOS */url('fonts/bold/BMitraBd.svg#svgBMitra') 格式('svg');/* 旧版 iOS */}

那么,有什么想法吗?这是 webkit 中的错误还是其他什么.提前致谢.


旁注:

  • 原始字体为真字体格式,我使用在线工具对其进行了转换.但我确信字体没有损坏,因为所有其他格式都可以正常工作.
  • 我刚刚发现有人遇到了同样的问题(这里是链接)但解决方案不是工作!它还破坏了 IE9 中的功能!
  • 我可以看到 Chrome 在 Chrome 的控制台中加载字体,因此问题不在于网页服务器或页面加载时字体资源不可用.

解决方案

这不是错误.您的字体不是标准的,而且它在 Firefox 11 中也不能正常工作(它显示了彼此分开的字符,这是坏字体的标志).您可以在此处找到适用于 Web 的新波斯字体系列.这些字体在新版本的浏览器中没有问题:demo link

The problem is that I'm using a custom Farsi font in my website named as BMitra (it is absolutely free in public domain) and all major browsers (latest FF and IE6+) are rendering this font just fine but my Chrome skips this font and switches to system's default tahoma.

Here is my CSS:

@font-face {
    font-family: 'BMitra';
    font-weight: normal;
    src: url('fonts/regular/BMitra.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
         url('fonts/regular/BMitra.woff') format('woff'), /* Modern Browsers */
         url('fonts/regular/BMitra.ttf')  format('truetype'), /* Safari, Android, iOS */
         url('fonts/regular/BMitra.svg#svgBMitra') format('svg'); /* Legacy iOS */
    }

@font-face {
    font-family: 'BMitra';
    font-weight: bold;
    src: url('fonts/bold/BMitraBd.woff') format('woff'), /* Modern Browsers */
         url('fonts/bold/BMitraBd.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
         url('fonts/bold/BMitraBd.ttf')  format('truetype'), /* Safari, Android, iOS */
         url('fonts/bold/BMitraBd.svg#svgBMitra') format('svg'); /* Legacy iOS */
    }

So, any ideas? is this a bug in webkit or something else. thanks in advance.


Side-notes:

  • The original font is in true-type format and I converted it using an online tool. but I'm sure that the font is not damaged because all other formats are working fine.
  • I've just figured out that someone had the same problem (here is the link) but the solution is not working at all! it also breaks functionality in IE9!
  • I can see that Chrome loads the fonts in Chrome's console so the problem is not with webserver or nonavailability of font resources at the time of page load.

解决方案

It's not a bug. Your font is not standard and also it's not working correctly in Firefox 11 as well (it shows the characters separated from each other which is the sign of the bad font). You can find the new series of Persian fonts for web here. These fonts have no issue with the new versions of the browsers: http://www.scict.ir/Portal

这篇关于波斯语 @font-face 在 Chrome 中不起作用,是否存在错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆