【发布时间】: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
所以我在 mac 上使用 Django、Python、HTML 和 CSS 创建了一个网站,其中使用了相当多的 Century Gothic 字体。然而,该网站将在 Linux 上运行,并且由于 Linux 没有 Century Gothic 字体,它看起来非常糟糕。我需要一种让 Century Gothic 字体在 Linux 上运行的方法。
【问题讨论】:
标签: python html css django fonts
您有两种方法可以做到这一点:
在您的服务器中上传Century Gothic Font 的“ttf”和“eot”(对于 IE9)文件,并在您的主 CSS 中写入类似的内容:
@font-face {
font-family: myFirstFont;
src: url('URL/CenturyGothic.ttf'),
url('URL/CenturyGothic.eot'); /* IE9 */
}
您可以使用来自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;
【讨论】:
在css中嵌入字体使用 @字体脸 http://www.w3schools.com/cssref/css3_pr_font-face_rule.asp
【讨论】: