Chrome과 Firefox는 Font-Awesome의 WOFF/TTF를 렌더링하지 않습니다. HttpListener에서 다운로드 한 경우에도 iOS의 Safari가 Font-Awesome을 올바르게 렌더링합니다.HttpListener 응답이있는 WOFF 및 TTF에 사용되는 ContentEncoding은 무엇입니까?
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 이외의) 다른 인코딩 유형이 있습니까 : 나는 다음과 같이 .NET의 HTTP Listener에 클래스를 사용하여 HTTP 응답을 보낸다? 또는 크롬이나 파이어 폭스에서 처리해야 할 부분이 있습니까?
도움이나 감사의 말씀 감사합니다.
해결책 주셔서 감사합니다. 그러나 문제가 해결되지 않았습니다. 내 글꼴이 아직 보이지 않습니다. Chrome은 여전히'다운로드 한 폰트를 디코딩하지 못했습니다 .'를 보여줍니다. – Vikrant
당신의 취향은 무엇입니까? CS 프로젝트에서'임베디드 리소스 '라고 불리는이 파일을 가지고 있습니다. .NET에서이 글꼴 파일을 UTF-8 인코딩으로 변환하는 동안 'assembly.GetManifestResourceStream' 메소드를 통해 글꼴 파일의 바이트를 가져 오는 동안 파일을'포함 리소스 '로 변환 할 가능성이 있습니까? – Vikrant