1

What is fallback font?

 3 years ago
source link: https://dev.to/aspose_slides/what-is-fallback-font-1b74
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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)

pic

CollapseExpand

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 modeExit 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

Comment button Reply

CollapseExpandCollapseExpand

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.

Comment button Reply


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK