How to use font-weight with font-face fonts?

后端 未结 3 424
自闭症患者
自闭症患者 2020-12-05 17:37

I\'ve got two font files like: FONT-light and FONT-bold. Both come from @font-face kit so each version has like 5 font files included (OGV, TTF, WOFF, EOT).

To go fr

3条回答
  •  生来不讨喜
    2020-12-05 18:16

    @font-face {
        font-family: 'DroidSerif';
        src: url('DroidSerif-Regular-webfont.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
    }
    @font-face {
        font-family: 'DroidSerif';
        src: url('DroidSerif-Italic-webfont.ttf') format('truetype');
        font-weight: normal;
        font-style: italic;
    }
    @font-face {
        font-family: 'DroidSerif';
        src: url('DroidSerif-Bold-webfont.ttf') format('truetype');
        font-weight: bold;
        font-style: normal;
    }
    @font-face {
        font-family: 'DroidSerif';
        src: url('DroidSerif-BoldItalic-webfont.ttf') format('truetype');
        font-weight: bold;
        font-style: italic;
    }
    

    From the tutorial: http://www.456bereastreet.com/archive/201012/font-face_tip_define_font-weight_and_font-style_to_keep_your_css_simple/

提交回复
热议问题