Phonegap 是关于 html、css 和 js 的。所以我需要在html/css中设置字体。我想在我的 html 页面中显示一些古吉拉特语字体。它适用于我桌面的浏览器。但这个页面在我的 Android 设备上没有显示。
HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css"
href="../jquery.mobile/jquery.mobile-1.3.1.css">
<script src="../jquery.mobile/jquery-1.9.1.min.js"></script>
<script src="../jquery.mobile/jquery.mobile-1.3.1.js"></script>
<!-- Cordova -->
<script type="text/javascript" charset="utf-8"
src="../js/cordova-2.5.0.js"></script>
<style type="text/css" media="screen">
@font-face {
font-family: centurySchoolbook;
src: url(../fonts/Shruti.ttf)format("opentype");
}
body {
font-family: centurySchoolbook;
font-size:30px;
}
</style>
</head>
<body>
<div style="font-family: 'centurySchoolbook';">શ્રુતિ ફોન્ટ શું છે અને તે કેવી રીતે વાપરવો ? </div>
</body>
</html>
Cordova : Cordova -2.5.0
安卓:4.1.2
我已将此行 src: url(/fonts/Shruti.ttf)format("opentype");
更改为 src: url(/fonts/Shruti.ttf)format( "truetype");
& 也用作 src: url(/fonts/Shruti.ttf)
。但无法在我的 Android 设备上工作。任何人都可以知道如何解决这个问题吗?任何帮助将不胜感激!!
它在三星 tab2 上显示古吉拉特语字体,但在任何设备中均不显示。
谢谢。
最佳答案
你必须做什么,你必须为古吉拉特语字体生成网络字体。由于您的字体安装在本地桌面上,因此它工作正常。
要生成网络字体,请查看此网址:
关于android - 如何在 Android 上的 Phonegap 中设置古吉拉特语字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19945578/