gpt4 book ai didi

android - Android 4.1.2 Phonegap (Cordova) 中的自定义波斯语和阿拉伯语字体无法正常工作

转载 作者:太空狗 更新时间:2023-10-29 16:37:03 26 4
gpt4 key购买 nike

我尝试在 phonegap 中为我的应用程序制作自定义字体。为此,我在我的 html 文件中编写了这段代码:

@font-face {
font-family: 'customfont';
src: url('fonts/BMitra.eot?#') format('eot'),
url('fonts/BMitra.woff') format('woff'),
url('fonts/BMitra.ttf') format('truetype');
font-style: normal;
}
body {
font-family: "customfont";
font-size:30px;
}

....

<body>
<h>Custom Fonts</h>
<div style="font-family: 'customfont';" id='txt1'>This is for sample</div>
</body>

它在 Ripple(chrome 模拟器)上运行良好,但在设备(Samsung Android 4.1.2)上不起作用

我用 googlestack-overflowed 找到了解决方案,我找到了这篇文章 font-face on android 4.0.x doesn't work它说有 text-rendreing:auto 但它也没有用。

任何帮助,将不胜感激。

最佳答案

终于我克服了波斯语和阿拉伯语自定义字体的这个问题,

保持所有带有@fontface的代码保持原样,下载此包 http://averta.net/labs/fa/?p=10

从提取的存档中,将 bifon-1.1b.js 添加到您的 html 并使用此脚本

function onDeviceReady() {

$('#txt1').text(FarsiStyle.convert('سلام عليكم').split('').reverse().join('').split(' ').reverse().join(' '));

}

哪个 txt1 是一个 div 或 span。

p.s 感谢 Morteza F. Shojaei 先生

关于android - Android 4.1.2 Phonegap (Cordova) 中的自定义波斯语和阿拉伯语字体无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25997479/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com