@ font-face在Android版Chrome中不起作用 [英] @font-face Not Working in Chrome for Android

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

问题描述

我正在使用 @ font-face 声明在网站上调用字体,它显示在 IE,FF,Chrome甚至是Mobile Safari 。但是,对于 Android(4.1.2),该字体未显示在 Chrome 18.0.1025308 中。

I'm using an @font-face declaration to call a font on a website and it displays in IE, FF, Chrome, even Mobile Safari. However, the font is not displaying in Chrome 18.0.1025308 for Android (4.1.2).

我使用的语法是 fontspring的防弹语法,我在确定阻止字体的问题时遇到了一个真正的问题

The syntax I'm using is fontspring's bulletproof syntax, and I'm having a real problem determining what is preventing the font from displaying properly.

CSS:

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

有什么想法吗?

推荐答案

问题可能与您的 font-family 声明有关(我不知道,因为您尚未发布该部分)。例如,如果您有以下内容:

The problem may be related to your font-family declaration (I can't tell because you haven't posted that part). If, for example, you had this:

font-family: fghjkjh, 'jump_startregular', sans-serif;

...适用于Android的Chrome浏览器会假装已安装fghjkjh(但实际上使用的是默认的Android字体),然后忽略其他所有内容。 (不确定这是错误还是功能。)

...Chrome for Android would simply pretend that fghjkjh is installed (but really use the default Android font) and ignore everything else. (Not sure if this is a bug or a feature.)

在这种情况下,解决方案是将 jump_startregular移到最前面-并可能添加<$而是将c $ c> local 源添加到 @ font-face 块,这可能会导致其他旧版浏览器出现问题。

In which case, the solution is to move 'jump_startregular' to the front - and possibly add a local source to the @font-face block instead, which probably causes problems with other older browsers.

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

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