我是云和Azure的新手,并为我今天工作的公司进行了首次部署。
目前位于http://fleetcarma.cloudapp.net,直到我能够获取域名以验证天蓝色服务器。
所以有些东西真的很奇怪,当我在本地运行我的Web服务或在IIS上部署时,我想要使用的字体可以工作。但是当部署到Azure时,它并没有默认为类似新罗马的时代。
我也包含了不同的字体类型。
这是CSS:
@font-face {
font-family: 'SlateStdBk';
src: url('/Content/ACTExpo/slatestd-bk1-webfont.eot');
src: url('/Content/ACTExpo/slatestd-bk1-webfont.eot?#iefix') format('embedded-opentype'),
url('/Content/ACTExpo/slatestd-bk1-webfont.woff') format('woff'),
url('/Content/ACTExpo/slatestd-bk1-webfont.ttf') format('truetype'),
url('/Content/ACTExpo/slatestd-bk1-webfont.svg#SlateStdBk') format('svg');
font-weight: normal;
font-style: normal;
}
我已将字体包含在内容文件夹中。我已经看到了这个:How can I install custom fonts on Windows Azure?,但这对我不起作用,因为我必须绘制所有文本,对吗?
如果有人能提供帮助,我将非常感激。 提前谢谢。
答案 0 :(得分:14)
谢谢@Seva Titov,我遇到同样的问题,在属性的Build Action下选择“Content”后,它就像一个魅力!
答案 1 :(得分:4)
对于那些正在推动某些东西并且不熟悉Web配置或非.net语言的人,您仍然可以创建web.config。
第1步:最佳做法,您不应该在真实的实时服务器上执行此操作:
第2步:在目录的根目录中创建一个名为' web.config' 的新文件 它应包含以下内容:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".woff" /> <!-- In case IIS already has this mime type -->
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
</staticContent>
</system.webServer>
</configuration>
答案 2 :(得分:3)
对于自定义字体添加
<staticContent>
<mimeMap fileExtension=".woff" mimeType="font/woff" />
</staticContent>
到Web.config的<system.webServer>
部分