2

所以我在 mac 上使用 Django、Python、HTML 和 CSS 创建了一个网站,它使用了相当多的 Century Gothic 字体。然而,该网站将在 Linux 上运行,并且由于 Linux 没有 Century Gothic 字体,它看起来非常糟糕。我需要一种让 Century Gothic 字体在 Linux 上运行的方法。

4

2 回答 2

6

你有两种方法可以做到这一点:

  1. 在您的服务器中上传一个“ttf”和一个“eot”(对于 IE9)文件,Century Gothic Font并在您的 main 中写入CSS如下内容:

    @font-face {
        font-family: myFirstFont;
        src: url('URL/CenturyGothic.ttf'),
             url('URL/CenturyGothic.eot'); /* IE9 */
    }
    
  2. 您可以使用来自 的 Century Gothic 替代方案(如Didact GothicGoogle Web fonts,因此,在<head>标签中放置以下代码:

    <link href='http://fonts.googleapis.com/css?family=Didact+Gothic' rel='stylesheet' type='text/css'>
    

    而且,在你的CSS

    font-family: 'Didact Gothic', sans-serif;
    
于 2013-04-07T06:11:13.890 回答
0

使用@font-face http://www.w3schools.com/cssref/css3_pr_font-face_rule.asp在css中嵌入字体

于 2013-04-07T04:22:44.000 回答