【问题标题】:Century Gothic Font in LinuxLinux 中的 Century Gothic 字体
【发布时间】:2013-03-29 07:52:54
【问题描述】:

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

【问题讨论】:

    标签: python html css django fonts


    【解决方案1】:

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

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

      @font-face {
          font-family: myFirstFont;
          src: url('URL/CenturyGothic.ttf'),
               url('URL/CenturyGothic.eot'); /* IE9 */
      }
      
    2. 您可以使用来自Google Web fonts 的世纪哥特式替代方案(如Didact Gothic),因此,在<head> 标记中输入以下代码:

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

      并且,在您的CSS

      font-family: 'Didact Gothic', sans-serif;
      

    【讨论】:

    • 所以“URL”可以是“/User/Name/project/CenturyGothic.ttf”之类的东西
    • 您可能更愿意选择一种不需要您支付许可费就可以在您的网站上使用它的字体。
    【解决方案2】:

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

    【讨论】:

    • 那么我应该把我的 Century Gothik ttf 文件保存在哪里才能使其正常工作?它在模板中吗?
    猜你喜欢
    • 2011-01-12
    • 1970-01-01
    • 2014-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多