这是我的herokuapp:https://majeddh.herokuapp.com ;我现在正在用它来测试字体。
这是我的 HTML 代码:
<?php echo 'majed'?><html>
<script src="http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
<style>
@import url('lateef.css');
h1 {
font-family: 'Lateef';
}
.wf-active h1 {
visibility: visible;
}
h2{
font-family:'lateef1';}
</style>
<body>
<h1>This headline will be hidden until Droid Sans is completely loaded.</h1>
<h1>ماجد</h1>
<h2>This headline will be hidden until Droid Sans is completely loaded.</h2>
<h2>ماجد</h2>
</body>
</html>
这是CSS:
@font-face {
/*this is arabic*/
font-family: 'Lateef';
font-style: normal;
font-weight: 400;
src: url(https://majeddh.herokuapp.com/FS_Metal2.TTF) format('truetype');
}
@font-face {
/*this is english*/
font-family: 'Lateef1';
font-style: normal;
font-weight: 400;
src: url(https://majeddh.herokuapp.com/FS_Metal1.ttf) format('truetype');
}
不知道问题出在哪里;英文字体出现,但阿拉伯字体不出现,我尝试了 3 种不同的字体,但出现了同样的问题。
最佳答案
代码中名为“Lateef1”的字体实际上是Baroque Script,并且不包含任何阿拉伯字母。名为“Lateef”的字体是Lucida Grande,但由于某种原因,即使是页面上的英文字母也没有使用它。这可能是由于对未经许可的使用进行了一些检查造成的。您应该检查您是否可以合法地将这些字体用作可下载字体;这需要版权所有者的许可。
关于html - 浏览器无法正确显示阿拉伯字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15638641/