我下载了一些字体作为工具包(ttf、eot、woff 等)。但是,在 Chrome 中,它们似乎有额外的 padding
或 margin
,这些在 Internet Explorer 或 Firefox 中不会显示。它似乎是顶部和底部。
我做了所有明显的 CSS 技巧,例如:
margin: 0;
padding: 0;
但这似乎是字体本身的问题。
这是其中一种字体:
@font-face {
font-family: 'Bebas';
src: url('bebas.eot');
src: url('bebas.eot?#iefix') format('embedded-opentype'), url('bebas.woff') format('woff'), url('bebas.svg#BebasRegular') format('svg'), url('bebas.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
有没有人知道任何编码技巧来修复或更好的转换/下载方法?
最佳答案
Bebas Neue 可在直接链接源上获得。 margin 0 和 padding 0 函数似乎工作正常。
tested in Chrome - works
tested in IE7 - works
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src='http://cdn.renderedfont.com/js/renderedfont-0.8.min.js#free'></script>
body
{
margin: 0;
padding: 0;
}
h1
{
font-family: "Bebas Neue", Arial;
font-size: 40px;
color: #99f;
}
<h1 class="renderedFont">Bebas Neue</h1>
关于html - Chrome 中自定义字体的额外填充或边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18219986/