How to add some non-standard font to a website?

后端 未结 19 1364
时光说笑
时光说笑 2020-11-22 02:17

Is there a way to add some custom font on a website without using images, Flash or some other graphics?

For example, I was working on a wedding website, and I found

19条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 02:41

    If by non standard font, you mean custom font of a standard format, here's how I do it, and it works for all browsers I've checked so far:

    @font-face {
        font-family: TempestaSevenCondensed;
        src: url("../fonts/pf_tempesta_seven_condensed.eot") /* EOT file for IE */
    }
    @font-face {
        font-family: TempestaSevenCondensed;
        src: url("../fonts/pf_tempesta_seven_condensed.ttf") /* TTF file for CSS3 browsers */
    }
    

    so you'll just need both the ttf and eot fonts. Some tools available online can make the conversion.

    But if you want to attach font in a non standard format (bitmaps etc), I can't help you.

提交回复
热议问题