DEV Community

loading...
Aspose.Slides

What is fallback font?

Alexandra Grazhevskaja
I am an IT specialist and experienced developer, working as Developer Evangelist.
Updated on ・1 min read

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!👇

Discussion (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
Collapse
stevenselcuk profile image
Steven J. Selcuk

This article explains well 👉css-tricks.com/snippets/css/system...

Collapse
gillmangareth profile image
Gareth Gillman • Edited

A fallback font is a font which will be used if your other choices aren't usable, for example in css if we want one font we would write:

font-family: font-name;

but we can also set fallback fonts which would be:

font-family: font-1, font-2, font-3;

If Font 1 isn't available, font-2 would be used, and so on.