0

For example, in this @fontface declaration that I found here, the CSS has a format('truetype') indicating that it's a .tff. But in my program, with and without doesn't make a difference.

font-face {
    font-family: 'DroidSerif';
    src: url('DroidSerif-Bold-webfont.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}
Ka Mok
  • 1,937
  • 3
  • 22
  • 47

1 Answers1

1

format is for helping the browser to understand the font format if it can't infer it automatically.

Modern browsers will just like at the font extension (.ttf in your case) or possibly the mime-type and infer it automatically without the need to explicitly specify the format.

Probably the only reason you would need it today is if you're using a non-standard file extension, or no extension at all, or possibly not using the correct mime-type.

Community
  • 1
  • 1
Andre Pena
  • 56,650
  • 48
  • 196
  • 243