【发布时间】:2014-07-21 22:54:58
【问题描述】:
我正在开发一个使用网络字体来显示泰语/老挝语字符的应用程序。为此,我定义了一个自定义字体,如下所示:
@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 serve 在 ionic 网络服务器上测试它时,它在 Firefox 和 Chrome 上运行良好:我可以看到字体已加载,字符显示正确(我在 Mac OS X Mountain Lion 上工作)。
然后,当我在我的 Android 设备(带有 Android 4.2.1 Jelly Beans 的 Galaxy Nexus)上使用 ionic run android 进行测试时,不会显示泰语/老挝语字符,而是有一个空格。
我通过加载符号字体来测试我的 webfont/font-face CSS 代码,以检查这些字母在网络浏览器和 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 页面的源代码中使用十六进制代码,但结果是一样的。
我真的很困惑......有什么想法吗??
谢谢!
【问题讨论】:
-
尝试删除
url()属性中的./ -
不幸的是它不起作用。我实际上认为 webfont 加载正确,但它是特殊字符(非拉丁 a-zA-Z ...)的显示,这似乎是 Android 设备上的问题,我不知道为什么。
-
还有一件事:我在普通网站上使用相同的webfont,当我使用Chrome浏览器从我的android设备浏览这个网站时,我可以正常看到它
标签: android font-face ionic-framework thai southeast-asian-languages