How to avoid calling “fonts.googleapis.com/css?family=..” for my CSS files
I am working on an asp.net mvc Intranet web application, and I am using a web layout template which I download from the web. Inside my CSS files there is the following line of code at the beginning of most of the CSS files (of course each CSS has a different font family name):-
The problem I am facing is that in the case of users accessing the aspnet mvc intranet and they do not have access to the internet, this is causing the browser to keep trying to download the files from
googleapis.com for around 10 seconds.
I am trying to provide these fonts inside my server, so that users will be served these files even if they do not have access to the internet.
Can anyone advise how I can add these fonts inside my asp.net mvc server, instead of retrieving these files from
And to give a basic answer, all you have to do is open all those googlefonts css links, copy their CSS files and font files (.svg, .woff., .utf., .ttf and .eot) , upload all those files to your host and make your css reffer to your localhost copies
Reasons to preffer WebfontLoader over CSS @import
</body>tag are executed last
- @import is not very much performance-wise
WebfontLoaderhave a function to do something while trying to load a font ( like showing another font or showing nothing ) and a function to do something if the font was not found ( like trying to load from another source or calling a js event )
WebfontLoadercan load only some characters of a googlefont (useful if you want to just show a page header with some font). That way you avoid badwitdh problems and your page is faster