簡體   English   中英

CSS自定義字體不起作用

[英]CSS Custom Font Not working

我已經在Windows中安裝了新字體,現在我想在我的網站中使用該字體作為自定義字體。 在下面的圖像中,它將描述我的所有問題http://i.imgur.com/hkbfA6O.png

在此處輸入圖片說明

這是我的代碼

<html>
    <head>
        <meta charset='uft-8' />
        <style type="text/css">
            @font-face {
                font-family: urdu;
                src: url(font/urdu/NOORIN01.TTF);
            }
            @font-face {
                font-family: eng;
                src: url(font/sansation_light.woff);
            }

            body{
                font-size:30px;
            }
            .urdu{font-family:'urdu';}
            .eng{font-family:'eng';}
        </style>
    </head>
    <body>
        <div class='urdu'>میں نے آپ کے مسئلے کو قتل کرنے جا رہا ہوں</div>
        <div>میں نے آپ کے مسئلے کو قتل کرنے جا رہا ہوں</div>
        <div class="eng">The quick and brown fox jump over the lazy dog.</div>
    </body>
</html>

這是字體文件
http://speedy.sh/WdxpP/sansation-light.woff
http://speedy.sh/wEzZ6/NOORIN01.TTF

字體壞了。 我使用指定地址中可用的NOORIN01.TTF字體進行了測試,並使用問題中的代碼進行了測試。 這是我在Firefox控制台(在Win 7上)看到的內容:

downloadable font: hdmx: Table discarded (font-family: "urdu" style:normal weight:normal stretch:normal src index:0)
source: [...]
downloadable font: not usable by platform (font-family: "urdu" style:normal weight:normal stretch:normal src index:0)
source: file:///C:/Users/Jukka/Documents/Fonts/NOORIN01.TTF

在字體檢查器中查看字體時,我注意到這些字符已分配給“專用”代碼點。 這樣可以“工作”,但是HTML內容需要包含這些代碼點。 由於字體中的某些表已損壞,因此它顯然無法工作。

結論是:找到另一種字體。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM