相关疑难解决方法(0)

WOFF字体的Mime类型?

什么mime类型应该作为WOFF字体?

我服务truetype(ttf)字体as font/truetype和opentype(otf)as font/opentype,但我找不到WOFF字体的正确格式.

我曾尝试font/woff,font/webopenfont/webopentype,但Chrome仍然会抱怨:

"资源被解释为字体,但使用MIME类型application/octet-stream进行传输."

有人知道吗?

embedded-fonts woff

548
推荐指数
9
解决办法
32万
查看次数

如何知道是否已加载字体(@ font-face)?

我正在使用Font-Awesome,但是在未加载字体文件时,图标显示为.

所以,我希望这些图标display:none不会加载文件.

@font-face {
  font-family: "FontAwesome";
  src: url('../font/fontawesome-webfont.eot');
  src: url('../font/fontawesome-webfont.eot?#iefix') format('eot'), url('../font/fontawesome-webfont.woff') format('woff'), url('../font/fontawesome-webfont.ttf') format('truetype'), url('../font/fontawesome-webfont.svg#FontAwesome') format('svg');
  font-weight: normal;
  font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)

我怎么知道这些文件已经加载,我终于能够显示图标了?

编辑: 我没有在页面加载(onload)时说话,因为字体可以在整个页面之前加载.

javascript css jquery font-face font-awesome

78
推荐指数
4
解决办法
6万
查看次数

Android上的CSS字体

我正在@font-face网站上展示League Gothic,但它并没有出现在Android 1.6上.这是我用Font Squirrel的@ font-face生成器生成的代码

@font-face {
    font-family: 'LeagueGothicRegular';
    src: url('/fonts/League_Gothic-webfont.eot');
    src: local('?'), url('/fonts/League_Gothic-webfont.woff') format('woff'), url('/fonts/League_Gothic-webfont.ttf') format('truetype'), url('/fonts/League_Gothic-webfont.svg#webfont') format('svg');
    font-weight: normal;
    font-style: normal;
}

font-family:'LeagueGothicRegular',Impact,Charcoal,sans-serif;
Run Code Online (Sandbox Code Playgroud)

如果@font-face不支持,这不是什么大问题(我读到@font-faceAndroid 2 中的支持完全消失了).但是联盟哥特式是非常浓缩的,所以我想为Android指定一个比默认的sans-serif更好的后备字体,所以设计并没有完全破解.

这样的事情将是完美的:http: //www.droidfonts.com/info/droid-sans-condensed-fonts/

但我找不到Android附带的默认字体的确切列表,以及我应该用它来在CSS中引用它们的名称.

编辑 到目前为止答案错过了重点(或者说我严重的问题) - 我所追求的是Android附带的系统字体列表.事情是这样的Android.

css android font-face

14
推荐指数
3
解决办法
4万
查看次数

为什么这些font-face中的一个在IE8中渲染,但其他的不是?

为什么在IE8中呈现此字体:

@font-face {
  font-family: 'Aller';
  src: url('aller_rg-webfont.eot');
  src: url('aller_rg-webfont.eot?#iefix') format('embedded-opentype'),
       url('aller_rg-webfont.woff') format('woff'),
       url('aller_rg-webfont.ttf') format('truetype'),
       url('aller_rg-webfont.svg#AllerRegular') format('svg');
  font-weight: normal;
  font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)

而这不是:

@font-face {
  font-family: 'Champagne';
  src: url('champreg-webfont.eot');
  src: url('champreg-webfont.eot?#iefix') format('embedded-opentype'),
       url('champreg-webfont.woff') format('woff'),
       url('champreg-webfont.ttf') format('truetype'),
       url('champreg-webfont.svg#Champagne&LimousinesRegular') format('svg');
  font-weight: normal;
  font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)

我真的无法弄明白.显然,所有其他浏览器工作正常.

css fonts internet-explorer font-face

7
推荐指数
1
解决办法
1万
查看次数