DEV Community

Alexandra Grazhevskaja for Aspose.Slides

Posted on • Edited on

What is fallback font?

I am exploring what fallback font is, working under an article about Aspose.Slides product. I am curious to know how would someone explain what is fallback font, like I am five!😀🤔

Please, explain me in comments!👇

Top comments (3)

Collapse
 
nataliedeweerd profile image
𝐍𝐚𝐭𝐚𝐥𝐢𝐞 𝐝𝐞 𝐖𝐞𝐞𝐫𝐝

Fallback (noun) - A fallback plan or position can be used if other plans do not succeed or other things are not available. - dictionary.cambridge.org/dictionar...

So basically fallback fonts are used when the current font isn't available. For example, if your CSS selector looked like this:

h1 {
    font-family: 'Roboto', 'Open Sans', Helvetica, Arial, sans-serif;
}
Enter fullscreen mode Exit fullscreen mode

The website will basically parse this as:

  1. Is 'Roboto' available? No? Try the next one.
  2. Is 'Open Sans' available? No? Try the next one.
  3. Is Helvetica available? No? Try the next one.
  4. Is Arial available? No? Try the next one.
  5. Final fall-back to genetic sans-serif font.

As soon as it finds a font which is available, it will stop. So if Helvetica was available, it would simply stop there and show that font.

Final fallback's should always be generic types, e.g.

  • serif
  • sans-serif
  • cursive
  • monospace

Some comments may only be visible to logged-in visitors. Sign in to view all comments.