首页 > 代码库 > css字体文件

css字体文件

├── glyphicons-halflings-regular.eot
├── glyphicons-halflings-regular.svg
├── glyphicons-halflings-regular.ttf
├── glyphicons-halflings-regular.woff

 

以上是bootstrap引入的四种字体文件。之前也觉得奇怪,后来才知道这四种文件涵盖了目前几乎所有的浏览器的字体文件需求格式。

 

eot is needed for Internet Explorers that are older than IE9 - they invented the spec, but eot is a horrible format that strips out much of the font features.

ttf and otf are normal old fonts, but some people got annoyed that this meant anyone could download and use them.

 

At the same time, iOS on the iPhone and iPad implemented svg fonts.

 

Then, woff was invented which has a mode that stops people pirating the font. This is the preferred format.

In iOS 5, iOS started to be able to use fonts that aren‘t SVG, I‘m not sure if it supports woff, but I think it does.

 

If you don‘t want to support IE 8 and lower, and iOS 4 and lower, and android, then you can just use WOFF.

css字体文件