4

我在使用自定义字体和@font-face. 我正在尝试在最新版本的 Chrome、Safari 和 Firefox 中获得一致的字体(在下面的屏幕截图中按顺序显示:

在此处输入图像描述

我正在使用以下内容来生成它:

@font-face {
    font-family: 'dineng';
    src: url('fonts/dineng.eot');
    src: url('fonts/dineng.eot?#iefix') format('embedded-opentype'),
         url('fonts/dineng.woff') format('woff'),
         url('fonts/dineng.ttf') format('truetype'),
         url('fonts/dineng.svg#dineng') format('svg');
    font-weight: normal;
    font-style: normal;
}

和:

.menu-button a {
    height:25px;
    float:left;
    border-bottom:2px solid white;  
    color:#ccccff;
    text-decoration:none;
    padding:8px 21px 0px 20px;
    text-align:center!IMPORTANT;
    background-color:#00378f;
    font-size:18px;
    font-family:'dineng', Arial;
    text-shadow:0 0 1px rgba(0,0,0,0.3);
    }

我已经尝试了所有字体重量的庄园来减少重量,但没有任何影响。我确实在 Chrome 上使用了下面的 CSS3 hack,让它看起来像我的 PSD,但这不适用于其他浏览器:

text-shadow:0 0 1px rgba(0,0,0,0.3);

在我跳出窗外之前,有没有人有什么建议!!

请注意我无法使用字体松鼠!

4

1 回答 1

3

试试这样:

@font-face {
    font-family: 'dineng';
    font-style: normal;
    font-weight: normal;
    src: url('fonts/dineng.eot');
    src: url('fonts/dineng.eot?#iefix') format('embedded-opentype'),
        url('fonts/dineng.woff') format('woff'),
         url('fonts/dineng.ttf') format('truetype'),
         url('fonts/dineng.svg#dineng') format('svg');
}

否则,请在您的计算机上打开 .TTF 文件。如果它已经显示为粗体,则字体将无法缩小,因为这是字体的正常外观。

于 2012-03-05T15:33:02.180 回答