2013-03-26 159 views
2

這是我的英雄應用程序: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種不同的字體,並出現相同的問題。

+0

Lateef1適合我,而Lateef不適合。你確定Lateef有正確的碼點嗎?阿拉伯語必須在unicode表格中,並且Lateef必須有這些點。 – Rudie 2013-03-26 13:50:29

回答

1

當我使用Firefox訪問你的頁面,Firebug控制檯說:

「NetworkError:404未找到 - https://majeddh.herokuapp.com/FS_Metal2.ttf

這似乎可以解釋這一切 - 字體文件丟失(在服務器上)。

+0

我更新了代碼,它是'FS_Metal2.TTF' – 2013-03-26 14:14:05

2

代碼中名爲「Lateef1」的字體實際上是巴洛克式腳本,它不包含任何阿拉伯字母。名爲「Lateef」的字體是Lucida Grande,但由於某種原因,即使頁面上的英文字母也不會使用。這可能是由於未經許可使用的一些檢查造成的。你應該檢查你是否可以合法地使用字體作爲可下載的字體;這需要版權所有者的許可。