android - 如何在 Android 上的 Phonegap 中设置古吉拉特语字体

标签 android html css cordova fonts

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 上显示古吉拉特语字体,但在任何设备中均不显示。

谢谢。

最佳答案

你必须做什么,你必须为古吉拉特语字体生成网络字体。由于您的字体安装在本地桌面上,因此它工作正常。

要生成网络字体,请查看此网址:

http://www.fontsquirrel.com/tools/webfont-generator

关于android - 如何在 Android 上的 Phonegap 中设置古吉拉特语字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19945578/

相关文章:

android - 在 Android 应用程序中重复背景横幅

android - Phonegap 应用程序 : Swipe from the screen edge

css - 如何在子 div 创建的形状周围应用边框

javascript - 试图让星级控制记住评级

android - 游标在调用此方法之前停用

android - AndEngine:获取 SIGSEGV 和 TouchEventPool 事件

javascript - slider 导航按钮将不显示

html - 对齐标题中的 div

javascript - jsoup html解析style=”display :none; dont show the link

javascript - 如何使用 "<Section> tag ID"使用 Javascript\Jquery 触发 anchor 链接?