非标准Webfont EurostileTRegExt

时间:2016-01-11 19:09:41

标签: css fonts

我希望我的网站字体为EurostileTRegExt。但是当我在font-family中输入时,它不会出现。我知道这是一种非标准字体(我必须下载它),但有没有办法服务器发布这种字体?我尝试将其上传到服务器但没有运气。

我有来自here的.tff文件。

body
{ 
  font-family: EurostileTRegExt, Arial, Georgia, Cordia New, Arial, Helvetica;
}

2 个答案:

答案 0 :(得分:0)

您必须指定字体的位置,并为其命名。

@font-face 
{
    font-family: EurostileTRegExt;
    src: url(yourpath/EurostileTRegExt.tff);
}

答案 1 :(得分:0)

在头标记中添加以下内容

<head>
  <meta charset="utf-8">
  <title></title>
  <style>
   @font-face {
    font-family: Pompadur; /* Name of the font, as specified in font file */
    src: url(fonts/pompadur.ttf); /* Path to font file on your server */
   }
   h1 {
    font-family: Pompadur, 'Comic Sans MS', cursive;
   }
  </style>
 </head>