Android 在PhoneGap应用程序上不加载CSS字体
我用PhoneGap在Android中实现了一个应用程序。因此,UI是用jQuery Mobile实现的。 我使用CSS字体为应用程序文本提供自定义字体Android 在PhoneGap应用程序上不加载CSS字体,android,cordova,jquery-mobile,Android,Cordova,Jquery Mobile,我用PhoneGap在Android中实现了一个应用程序。因此,UI是用jQuery Mobile实现的。 我使用CSS字体为应用程序文本提供自定义字体 @font-face { font-family: "MyFont"; src: url("../fonts/MyFont.ttf") format("truetype"), src: url("../fonts/MyFont.otf") format("opentype"); } body { font-fam
@font-face {
font-family: "MyFont";
src: url("../fonts/MyFont.ttf") format("truetype"),
src: url("../fonts/MyFont.otf") format("opentype");
}
body {
font-family: MyFont;
}
但是,当我在Android上安装应用程序时,文本会以默认字体显示
如何在Android中解决此问题?这是适用于Android手机的正确语法:
@font-face {
font-family: 'yanone';
src: url('fonts/yanone/YanoneKaffeesatz-Regular-webfont.eot?') format('eot'),
url('fonts/yanone/YanoneKaffeesatz-Regular-webfont.woff') format('woff'),
url('fonts/yanone/YanoneKaffeesatz-Regular-webfont.ttf') format('truetype'),
url('fonts/yanone/YanoneKaffeesatz-Regular-webfont.svg#webfont') format('svg');
font-weight: normal;
font-style: normal;
}
您还应该注意自定义字体的相对路径