Chrome 和 Firefox 不会渲染 Font-Awesome 的 WOFF/TTF,即使他们从 HttpListener 下载它们,也就是说,iOS 上的 Safari 正在正确渲染 Font-Awesome。我正在使用 .NET 的 HttpListener 类发送 HTTP 响应,如下所示:
private void Send(HttpListenerContext context, byte[] response, string contentType)
{
context.Response.StatusCode = (int)HttpStatusCode.OK;
context.Response.ContentEncoding = Encoding.UTF8;
context.Response.ContentType = contentType;
context.Response.ContentLength64 = response.Length;
context.Response.AddHeader("Server", SERVER);
if (response == null || response.Length == 0)
{
logger.Error("Send: Engine generated null or empty content");
context.Response.StatusCode = (int)HttpStatusCode.NotFound;
return;
}
using (var s = context.Response.OutputStream)
{
s.Write(response, 0, response.Length);
}
}
WOFF 是否有另一种编码类型(UTF8 除外)?或者在 Chrome 或 Firefox 中我有什么需要注意的吗?
任何帮助或指针表示赞赏,谢谢。