【发布时间】:2015-05-07 05:27:34
【问题描述】:
我需要能够在我的网站上使用特定的泰卢固语字体。我有 ttf 文件并生成了所需的 .eot、.woff、.woff2 和 .svg 文件。我按照下面网站上的说明创建了我的样式表,如下所示
@font-face {
font-family: 'sree_krushnadevarayaregular';
src: url('Sree Krushnadevaraya-webfont.eot');
src: url('Sree Krushnadevaraya-webfont.eot?#iefix') format('embedded-opentype'),
url('Sree Krushnadevaraya-webfont.woff2') format('woff2'),
url('Sree Krushnadevaraya-webfont.woff') format('woff'),
url('Sree Krushnadevaraya-webfont.ttf') format('truetype'),
url('Sree Krushnadevaraya-webfont.svg#sree_krushnadevarayaregular') format('svg');
font-weight: normal;
font-style: normal;
}
.badifont {
position: relative;
top: 1px;
display: inline-block;
font-family: 'sree_krushnadevarayaregular';
font-style: normal;
font-weight: normal;
line-height: 1;
}
https://css-tricks.com/snippets/css/using-font-face/
但是,当我使用我创建的新类时,文本不会以我期望的字体显示。它使用的是我机器上可用的默认泰卢固语字体。
我错过了什么?
【问题讨论】:
-
我将代码更改为使用
<font face="Sree Krushnadevaraya">డే మొయిన్ తెలుగు బడి</font>,并将字体更改为我所期望的。但这可能只有在我在本地安装该字体时才有效??