你好,我正在使用字体I2of5nt,因为我需要在一个html中创建一个barCode。我在我的css中写道:
@font-face {
font-family: 'I2of5nt';
/* for IE */
src: url(template/css/I2of5nt.ttf) format ('ttf');
/* non-IE */
src: local("I2of5nt"), url(template/css/I2of5nt.ttf) format("truetype");
font-style: normal;
font-weight: normal;
}
.barCode{
font-family:'I2of5nt';
}在html中,我有:
<div class="barCode">12312312</div>但是它没有显示条形码,你知道是怎么回事吗?看起来我应该写另一个参数,但我真的不知道。
谢谢
发布于 2014-07-15 12:04:33
所以你可能用错了@font-face。
最好的方法是通过fontsquirrel.com或fontprep (mac版)这样的编译器将其编译成webfont。您的代码应如下所示
@font-face {
font-family: 'MyFont';
src: url('MyFont.eot');
src: url('MyFont.svg#e6614ac1ffeb97962de474601fd3ce1d') format('svg'),
url('MyFont.eot?#iefix') format('embedded-opentype'),
url('MyFont.woff') format('woff'),
url('MyFont.ttf') format('truetype');
font-style: normal;
font-weight: 700;
}https://stackoverflow.com/questions/24749525
复制相似问题