自托管谷歌字体在任何浏览器中都不流畅

时间:2017-12-13 22:06:22

标签: html css fonts font-face

我得到了" Lato"谷歌字体,并希望自我托管(因为性能)。我得到了它的实现,它在任何浏览器中看起来都很糟糕而且不流畅,它看起来真的像素化了!

enter image description here

 @font-face {
    font-family: 'lato';
    src: url('font/latoFont.eot');
    src: url('font/latoFont.eot?#iefix') format('embedded-opentype'),
    url('font/latoFont.ttf') format('truetype'),
    url('font/latoFont.woff2') format('woff2'),
    url('font/latoFont.woff') format('woff');
    font-weight: 500;
    font-style: normal;
}

html {
    font-family: 'lato', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-size: 10px;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1.4rem;
    color: #212121;
}

我能做些什么来获得更令人满意和顺利的结果?

1 个答案:

答案 0 :(得分:0)

我通常使用此修补程序

/*FIX FONT FOR GOOGLE CHROME ON WINDOWS*/
@media screen and (-webkit-min-device-pixel-ratio:0) {
    @font-face {
        font-family: 'MyFont';
        src: url('fonts/myfont.svg#myfont') format('svg');
        font-weight: normal;
        font-style: normal;}
}

您可以阅读更多here

相关问题