What does format do in typography

Typography | Codecademy

When use

@font-face {
  font-family: "Croissant One"
  src: url('../fonts/CroissantOne-Regular.tff') format(truetype);
}

and when use

@font-face {
  font-family: "Croissant One"
  src: url('../fonts/CroissantOne-Regular.tff');
}

What does “format” do?

Hi there!

So, when using @font-face, src allows you to dictate the resource dictating the font data. From there, the format() function gives the browser an “idea” of what kind of format the font resource is, and by providing multiple url() sources, you give the browser different options–selecting the most suitable format.

Hope this helps!

1 Like

so I just need to use format when provided multiple url?