if(decodeURI(url.parse(req.url).pathname)=="/方正卡通简体.ttf"){ fs.readFile("./方正卡通简体.ttf",Buffer,function(err,data){ zlib.gzip(data, function(err,buffer){ if(!err){ res.writeHead(200,{'Content-Type':"application/x-font-ttf","Content-Length":data.length,"Accept-Encoding":'gzip'}); res.end(buffer,"binary"); } else{ console.log(err); } }) }) }
不能用 TAT
回复 (4)
N
没有用框架?
M
head里用标准的下载头部。不要用TTF头。
S
引用 MiguelValentinehead里用标准的下载头部。不要用TTF头。
@MiguelValentine 好的。。我试试,多谢
S
引用 nihgwu没有用框架?
@nihgwu 没。一个小demo没必咩- -
参与回复
登录后即可参与回复。登录