ファイル内でレンダリングするフォントを取得しようとしていますが、通常のエラーが表示されます
Resource interpreted as Font but transferred with MIME type text/html:
しかし、表示されている HTML ファイルは 404.aspx ファイルです。アプリケーションを web.config にインストールし、最終的に IIS 自体に次のようにインストールするという通常の方法を試しました。
.woff application/font-woff
.ttf application/font-ttf
.eot application/vnd.ms-fontobject
.otf application/font-otf
.svg image/svg+xml
どこが間違っているのか理解できません。ファイルは、サイトのベース ディレクトリにある fonts というフォルダーに保存され、aspx ファイル内に次のようなスタイルがあります。
@font-face {
font-family: 'segoe_printregular';
src: url('/fonts/segoepr-webfont.eot'); /* IE9 Compat Modes */
src: url('/fonts/segoepr-webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/fonts/segoepr-webfont.woff') format('woff'), /* Modern Browsers */
url('/fonts/segoepr-webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('/fonts/segoepr-webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
font-weight: normal;
font-style: normal;
}
fonts フォルダー内の stylesheet.css は次のようになります。
@font-face {
font-family: 'segoe_printregular';
src: url('/segoepr-webfont.eot'); /* IE9 Compat Modes */
src: url('/segoepr-webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/segoepr-webfont.woff') format('woff'), /* Modern Browsers */
url('/segoepr-webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('/segoepr-webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
font-weight: normal;
font-style: normal;
}
ファイルパスを /fonts/ として試してみましたが、 fonts/ だけでは役に立ちませんでした。しかし、ファイルをbnot 404にすることはできません。誰かがサーバーを再起動することを提案しましたが、それも何も達成しませんでした.
不足しているものはありますか?それとも私が犯した間違いですか?
それが役立つ場合は、web.configでもこれを試しました
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<remove fileExtension=".ttf" />
<mimeMap fileExtension=".ttf" mimeType="application/font-ttf" />
<remove fileExtension=".eot" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<remove fileExtension=".otf" />
<mimeMap fileExtension=".otf" mimeType="application/font-otf" />
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>