繁体   English   中英

问题是独特的字体名称,是否需要脚本?

[英]Issue with unique font names, are scripts required?

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

以下是我的css:

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

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

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

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

我看了一下你提供的链接,这就是你应该如何做到的。

转到fontsquirrel并上传你的BALLW ___。TTF文件,它将生成你需要的其他字体扩展+字体规则看起来像这样的字体规则:

@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:别忘了上传你的字体

修改此代码以使用您的字体并将其添加到您的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
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM