CSS字体:如何将多个TTF文件转换为一个文件? [英] CSS Fonts: Howto convert multiple TTF files into one file?

查看:649
本文介绍了CSS字体:如何将多个TTF文件转换为一个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了多个TTF字体文件。需要转换成1个文件,我可以在CSS中使用。

I received multiple TTF font files. Need to convert into 1 file which I can use in CSS.

我该如何做?

感谢

推荐答案

你不能这样做,每个字体需要它自己的单独的文件。您可以使用服务将ttf转换为eot和svg文件,然后在style.css(假设是您的样式表的名称)文件中使用这样的代码:

You can't do it, each font needs it's own separate file. You can use a service to convert a ttf to eot, and svg files and then use some code like this in your style.css (assuming that's the name of your stylesheet) file:

@font-face {
    font-family: 'FuturaM';
    src: url('fonts/FuturaMedium.eot');
    src: url('fonts/FuturaMedium.eot?#iefix') format('embedded-opentype'),
         url('fonts/FuturaMedium.ttf') format('truetype'),
         url('fonts/FuturaMedium.svg#FuturaMedium') format('svg');
}

希望这有助!

这篇关于CSS字体:如何将多个TTF文件转换为一个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆