Is there a website, portal or library that is used to
guard against this risk?
There is the property font-family
of CSS
, you can list a number of fonts for your document, they will be used in the order you set.
Let’s see in practice, imagine that you have defined the following sources:
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
The CSS
will attempt to style with the first stated source, if it exists on the reader’s computer, in which case the source "Palatino Linotype"
will be displayed, and if it is not present, the style CSS
will attempt to be done with the second source. And finally, if you don’t have any of the fonts on the user’s computer, the browser will show a standard system font. Recommends - if the last source in the list is a generic source: serif
, sans-serif
, monospace
, cursive
or fantasy
. This allows the browser to choose a similar font in the generic family, if no other font is available.
There is also the library Google Web Fonts, which contain web-based sources and all tested and approved by the google platform.
Using the @import
:
@import url('https://fonts.googleapis.com/css?family=Titillium+Web');
Ultilizing the font in the desired tag:
h1 {
font-family: 'Titillium Web', sans-serif;
}
Remember: The @import
is an element CSS
, then if it is placed on <head>
of HTML
, it should always stay within a tag <style>
.
Using the tag <link>
:
The tag <link>
, other than @import
goes right into the <head>
of HTML
. See the example with the same font used in the example above.
<head>
<title>Google Fonts</title>
<link href='http://fonts.googleapis.com/css?family=Dancing+Script' rel='stylesheet' type='text/css'>
</head>
Recalling that the Webfonts already provides ready-to-insert code in your CSS or HTML.
References:
It’s not really my area, but in case you’d put more than one source as backup.
– Luiz Augusto
Are you using some source CDN like Google Source? Or are you using some
@font-face
with custom font? You need to give more details, and if possible include your CSS– hugocsl