0

试图将我的标题 1 的字体更改为 ballpark Weiner。

下面是我的CSS:

h1 {color: #000000; font-family: Ballpark Weiner; 
        font-size: 40px;
}

试图让字体看起来像这样:

http://www.fontgirl.com/info/ballpark.php

它最终看起来像 Arial 类型的字体。像这样的unqiue字体,是否需要插入脚本?如果当前字体需要屏幕截图,请告诉我。

4

2 回答 2

2

我查看了您提供的链接,这就是您应该这样做的方式。

转到fontsquirrel并上传您的BALLW___.TTF文件,它将生成您需要的其他字体扩展名 + fontface 规则 font-face 规则看起来像:

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

将其包含在您的 css 文件中,然后您可以像这样使用它

css selector
{
font-family: 'fontname';
}

ps:别忘了上传你的字体

于 2013-04-07T23:11:47.010 回答
0

修改此代码以使用您的字体并将其添加到您的 CSS 文件中。

@font-face {
    font-family: cool_font;
    src: url('cool_font.ttf'); // link to the font
}

那么当你想使用它时,只需这样做

p.custom_font {
    font-family: cool_font; // no .ttf
}
于 2013-04-07T23:08:59.780 回答