Chrome中自定义字体的额外填充或边距

时间:2013-08-13 22:02:46

标签: html css google-chrome font-face

我有一些我作为工具包下载的字体(ttf,eot,woff等)。但是,在Chrome中,它们似乎有额外的paddingmargin,这些内容未显示在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;
}

有没有人知道要修改的编码技巧或更好的转换/下载方式?

1 个答案:

答案 0 :(得分:0)

FOR LIVE DEMO

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>