【发布时间】:2017-03-08 08:06:19
【问题描述】:
我需要将谷歌开源字体添加到我的 ASP.Net 应用程序中。 目前我已经使用谷歌api的链接将它们包括在内,如下所示
<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>
但问题是当我在没有互联网的开发环境中运行我的 Web 应用程序时,这些字体将不起作用。
所以我需要做的是在我的 ASP.Net 应用程序中包含这些字体作为引用,就像我们在应用程序中包含 javascript(.js) 和 css(.css) 文件一样。
例如:
<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>
所以我需要通过添加对谷歌字体文件的引用来在没有互联网的情况下运行我的网络应用程序。有没有办法做到这一点?
【问题讨论】:
-
您可以下载谷歌字体并将其安装在您的开发环境中,并保持链接标签不变,这样当互联网可用时(在不同的环境中),它们将被下载