1

我正在开发一个使用 webfont 来显示泰语/老挝语字符的应用程序。为此,我定义了一个自定义字体,如下所示:

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

现在,当我在 ionic 网络服务器上测试它时,ionic serve它在 Firefox 和 Chrome 上运行良好:我可以看到字体已加载,字符显示正确(我在 Mac OS X Mountain Lion 上工作)。

然后,当我在我的 android 设备(带有 Android 4.2.1 Jelly Beans 的 Galaxy Nexus)上进行测试时ionic run android,泰语/老挝语字符没有显示,而是有一个空格。

我通过加载符号字体来测试我的 webfont/font-face CSS 代码,以检查字母是否被 web borwser 以及 android 设备上的符号替换,并且运行良好。

我试图修复 index.html 上的元标记,但没有奏效:

<meta http-equiv="content-type" content="text/html; charset=UTF-8"> 
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

我还尝试在我的 html 页面的源代码中使用十六进制代码,但结果是一样的。

我真的很困惑......有什么想法吗?

谢谢!

4

1 回答 1

0

找到了根本原因,但不幸的是这不是好消息:

  1. Android 字体不支持老挝字形(例如与 iOS 相反),因此如果不使用自定义字体,它将显示空白。
  2. Android 股票浏览器不支持@font-face CSS,这已在 Android 4.4 上得到修复,但仍会影响所有其他 Android 4.x 版本(67% 的设备!)

不是好消息,希望谷歌能修补其他安卓版本:[

于 2014-07-25T23:05:32.420 回答