从这个字符串开始:
वृत्तयः पञ्चतय्यः क्लिष्टाक्लिष्टा我正尝试在我的移动设备上渲染它(通过Cordova / PhoneGap )。
在我的浏览器( localhost:8000 )上,它显示得很好。正如它在示例中显示的那样。但在我的设备上,它看起来像这样:

它肯定采用了我的字体( Karma-Light ),因为我注意到它的别名比默认的Helvetica,sans-serif等要好。
我的CSS看起来像这样:
@font-face {
font-family: 'Karma';
src: local('Karma'), url('../fonts/Karma-Light.ttf') format('truetype');
unicode-range: U+0900–097F;
font-weight: normal;
font-style: normal;
}
.devanagari { font-family: 'Karma', Helvetica, Arial, sans-serif; }我尝试了各种不同的unicode范围,并省略了unicode范围,但所有内容都以相同的方式显示。
有什么想法吗?
发布于 2016-08-11 03:03:04
以防有人被困在这里!
在/src/中打开index.html
并确保上面写着这一点!
<meta charset="utf-8" name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">声明字符集可以使其正常工作。
https://stackoverflow.com/questions/38879679
复制相似问题