MVC 4谷歌字体 - 内联网 [英] MVC 4 Google Fonts - Intranet

查看:153
本文介绍了MVC 4谷歌字体 - 内联网的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MVC4 4引导项目这使得非常清楚在本地通过Visual Studio 2010中,但是当我发布到用于我们的内网无法访问资源 HTTP内部IIS://fonts.googleapis。 ?COM / CSS系列=蒙特塞拉特:400 所以能有人解释我是如何本地化此远程资源,使IIS引用在本地

I have a MVC4 4 Bootstrap project which renders perfectly well locally via Visual Studio 2010 but when I publish to the internal IIS used for our Intranet I cannot access the resource http://fonts.googleapis.com/css?family=Montserrat:400 so could somebody explain how I localise this remote resource so that IIS references it locally.

任何帮助将是非常美联社preciated: - )

Any help would be much appreciated :-)

推荐答案

要本地化谷歌的字体我添加的地址 http://fonts.googleapis.com/css?family=Montserrat:400 中返回一个css文件浏览器的地址栏。

To localise the Google Fonts I added the address http://fonts.googleapis.com/css?family=Montserrat:400 in to my browser address bar which returns a css file.

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  src: url(http://themes.googleusercontent.com/static/fonts/montserrat/v4/zhcz-_WihjSQC0oHJ9TCYFQlYEbsez9cZjKsNMjLOwM.eot);
  src: local('Montserrat-Regular'), url(http://themes.googleusercontent.com/static/fonts/montserrat/v4/zhcz-_WihjSQC0oHJ9TCYFQlYEbsez9cZjKsNMjLOwM.eot) format('embedded-opentype'), url(http://themes.googleusercontent.com/static/fonts/montserrat/v4/zhcz-_WihjSQC0oHJ9TCYBsxEYwM7FgeyaSgU71cLG0.woff) format('woff');
}

然后我从加入上面的CSS每个URL在其中下载相关的.eot和.woff文件我的地址栏。我只是改名为一个更符合逻辑的名称下载的文件,并复制文件到/内容/ fonts目录。

I then added each url from the above css into my address bar which downloaded the associated .eot and .woff files. I simply renamed the downloaded files with a more logical name and copied the files into the /Content/fonts directory.

我则包括以下到我boostrap.css文件。

I then included the following into my boostrap.css file.

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  src: url(fonts/montserrat-400.eot);
  src: local('Montserrat-Regular'), url(fonts/montserrat-400.eot) format('embedded-opentype'), url(fonts/montserrat-400.woff) format('woff');
}

嘿preSTO,所有的字体正确地呈现一个内部IIS服务器上。

Hey presto, all fonts render correctly on an internal IIS server.

这篇关于MVC 4谷歌字体 - 内联网的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆