简体   繁体   English

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

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

trying to change my header 1's font to ballpark Weiner. 试图将我的标题1的字体改为ballpark Weiner。

Below is my css: 以下是我的css:

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

Trying to get the font to look like this: 试图让字体看起来像这样:

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

It ends up looking like a Arial type of font. 它最终看起来像Arial类型的字体。 For unqiue fonts like this, are there scripts required to be inserted? 对于像这样的unqiue字体,是否需要插入脚本? If a screen shot is needed for current font please let me know. 如果当前字体需要屏幕截图,请告诉我。

I took a look at the link you provided, and this is how you should to it. 我看了一下你提供的链接,这就是你应该如何做到的。

Go to fontsquirrel and upload your BALLW___.TTF file, and it will generate the other font extensions that you need + the fontface rules the font-face rules would look something like: 转到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;
}

include that in your css file then you can use that like this 包含在你的css文件中然后你可以像这样使用它

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

ps: dont forget to upload your fonts ps:别忘了上传你的字体

Modify this code to work with your font and add it to your CSS file. 修改此代码以使用您的字体并将其添加到您的CSS文件中。

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

then when you want to use it just do this 那么当你想要使用它时就这样做吧

p.custom_font {
    font-family: cool_font; // no .ttf
}

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

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