所以即时通讯工作在一个新的网站上。我使用font squirrel创建了自定义字体(ttf)并从中生成了网页字体。字体嵌入效果很好,在桌面上跨浏览器。它也适用于ios设备。但在Android设备上,我用于网站徽标的单个字符正在垂直裁剪。少于一半的字形正在显示。它几乎好像它是一个精确的正方形(标志是长的水平)见下面的截图...android/chrome web字体渲染问题 - 垂直/宽度裁剪
我已确认在一个星系S3,Nexus 5的这种行为,和Nexus 7使用无论是股票的Android浏览器或谷歌浏览器。如果您注意到,它下面还有3个其他图标(圆圈),它们来自同一个webfont并呈现正常。该徽标实际上以较小的字体大小正确呈现。
我使用下面的CSS:
/* font styles */
@font-face {
font-family: 'lticons';
src: url('fonts/lticons-webfont.eot?v=1.1.1');
src: url('fonts/lticons-webfont.eot?#iefix&v=1.1.1') format('embedded-opentype'),
url('fonts/lticons-webfont.woff?v=1.1.1') format('woff'),
url('fonts/lticons-webfont.ttf?v=1.1.1') format('truetype'),
url('fonts/lticons-webfont.svg?v=1.1.1#lticons') format('svg');
font-weight: normal;
font-style: normal;
}
.lt {
display: inline-block;
font-family: lticons;
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.lt .logo:before {
content: "\f000";
}
/* html styles */
.hero {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.hero .logo {
position:absolute;
display:block;
overflow:visible;
text-overflow:string;
font-size:20em;
color:#fff;
top:25%;
left:50%;
-webkit-transform:translate(-50%,-25%);
-moz-transform:translate(-50%,-25%);
-ms-transform:translate(-50%,-25%);
-o-transform:translate(-50%,-25%);
transform:translate(-50%,-25%);
text-shadow:rgba(0,0,0,.5) 1px 1px 1px
}
和下面的HTML渲染它:
<section class="home col-xs-12">
<div class="hero">
<i class="lt logo"></i>
<h1>Transaction intelligence & customer<br/>insites for the mobile world</h1>
</div>
</section>
我已经尝试瓦特/和W/O转换代码。这种黑客只涉及定位。它呈现相同。有什么建议么?谢谢。
如果不能引用字体就很难测试它。你可以在jsbin.com – Kinlan