Linux中的Century Gothic字体

Cod*_*low 2 html css python django fonts

所以我使用Django,Python,HTML和CSS在mac上创建了一个网站,它使用了很多Century Gothic字体.然而,该网站将在Linux上运行,因为Linux没有字体Century Gothic,它看起来非常糟糕.我需要一种方法来使Century Gothic字体在Linux上运行.

Sni*_*olf 6

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

  1. 上传服务器中的"ttf"和"eot"(用于IE9)文件,Century Gothic Font并在主要内容中写入CSS:

    @font-face {
        font-family: myFirstFont;
        src: url('URL/CenturyGothic.ttf'),
             url('URL/CenturyGothic.eot'); /* IE9 */
    }
    
    Run Code Online (Sandbox Code Playgroud)
  2. 您可以使用Century Gothic替代品(如Didact Gothic)Google Web fonts,因此,在<head>标签中放置此代码:

    <link href='http://fonts.googleapis.com/css?family=Didact+Gothic' rel='stylesheet' type='text/css'>
    
    Run Code Online (Sandbox Code Playgroud)

    而且,在你的CSS:

    font-family: 'Didact Gothic', sans-serif;
    
    Run Code Online (Sandbox Code Playgroud)