作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我尝试在 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)上不起作用
我用 google
和 stack-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/
我使用 Highcharts 绘制一些图表。我的语言是波斯语(波斯语),我想用波斯数字绘制图表。但是在 Highcharts 中,所有数字都以英文显示。 有没有办法用波斯语显示数字(所有数字:yaxi
我是一名优秀的程序员,十分优秀!