我已经使用http://www.fontsquirrel.com/fontface/generator生成了GillSans字体的各种版本(.svn,.eot ...)。

我现在可以这样使用它:

@font-face {
  font-family: 'GillSansFF';
  src: url('fonts/GillSans.eot');
  src: local('☺'), url('fonts/GillSans.woff') format('woff'), url('fonts/GillSans.ttf') format('truetype'), url('fonts/GillSans.svg') format('svg');
  font-weight: normal;
  font-style: normal;
}

h1 {
    font-family: "GillSansFF", Calibri, sans-serif;
}


由于GillSans还包含“ Gill Sans Light”(粗体,斜体等),因此如何指定“ Light”版本?谢谢

编辑如前所述,该解决方案使用不同的字体。要从单个ttc中提取ttf,我找到了这个有效的Python脚本:http://pastebin.com/QXcAtP24

最佳答案

只需为您的浅色字体添加一个额外的@ font-face声明:

@font-face {
  font-family: 'GillSansFF';
  src: url('fonts/GillSans.eot');
  src: local('☺'), url('fonts/GillSans.woff') format('woff'), url('fonts/GillSans.ttf') format('truetype'), url('fonts/GillSans.svg') format('svg');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'GillSansFF';
  src: url('fonts/GillSans-light.eot');
  src: local('☺'), url('fonts/GillSans-light.woff') format('woff'), url('fonts/GillSans.ttf') format('truetype'), url('fonts/GillSans-light.svg') format('svg');
  font-weight: lighter;
  font-style: normal;
}

10-05 20:56
查看更多