1

I need to add google opensource fonts to my ASP.Net application. Currently I've included them using the link to google apis as follows

<head runat="server">

    <!-- Google Fonts -->
    <link href='http://fonts.googleapis.com/css?family=Titillium+Web:400,200,300,700,600' rel='stylesheet' type='text/css'/>
    <link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:400,700,300' rel='stylesheet' type='text/css'/>
    <link href='http://fonts.googleapis.com/css?family=Raleway:400,100' rel='stylesheet' type='text/css'/>

</head>

But the problem is when I run my web application in the development environment without internet these fonts won't work.

So what I need to do is include these fonts as references in my ASP.Net application just as we include javascript(.js) & css(.css) files to the application.

eg:

<link rel="stylesheet" href="css/owl.carousel.css"/>
<link rel="stylesheet" href="style.css"/>
<link rel="stylesheet" href="css/responsive.css"/>
<script src="jq/jquery.min.js"></script>

So I need to run my web application without internet by adding references to google font files. Is there any way to do this?

tarzanbappa
  • 4,930
  • 22
  • 75
  • 117
  • You can download the google fonts and install it in your dev environment, and keep the link tags as it is, so when internet is available (in a different environment), they will be downloaded – Thangadurai Oct 26 '16 at 05:18
  • See http://stackoverflow.com/questions/16994372/local-fallback-for-google-web-fonts for some good suggestions – LDJ Oct 26 '16 at 05:19

1 Answers1

1

You can download the fonts and host them on your local devel webwserver, and include them much the same way, see the google-webfonts-helper here:

https://google-webfonts-helper.herokuapp.com/fonts

This will require you to just swap out the css parts between debug and release builds, using build events or some custom processing.

edit: much more usefull info here: How to host google web fonts on my own server?

Community
  • 1
  • 1
Bob Noordam
  • 61
  • 1
  • 2