custom @font-face does not load in chrome (chrome

2019-06-20 14:55发布

custom @font-face does not load in chrome(chrome custom fonts not rendering) Using custom fonts using CSS

@font-face {
    font-family:'gotham-rounded-medium';
    src:url('fonts/gothumrounded_medium/gotham-rounded-medium.eot');
    src:url('fonts/gothumrounded_medium/gotham-rounded-medium.eot?#iefix')format("embedded-opentype"),
        url('fonts/gothumrounded_medium/gotham-rounded-medium.woff')format("woff"),
        url('fonts/gothumrounded_medium/gotham-rounded-medium.ttf')format("truetype"),
        url('fonts/gothumrounded_medium/gotham-rounded-medium.svg')format("svg");
    font-weight:400;
    font-style:normal
}

.custom_font{
   font-family:'gotham-rounded-medium', arial, sans-serif;
}

enter image description here

The texts are showing only when you resize the screen window.

So please is there something that it can be done to solve this issue?

2条回答
Viruses.
2楼-- · 2019-06-20 15:27

In my case the problem was connected with multiple inclusion of the same @font-face made by different Angular 2 modules. Please see:

https://bugs.chromium.org/p/chromium/issues/detail?id=582198#c20

查看更多
你好瞎i
3楼-- · 2019-06-20 15:46

Looks like this is getting fixed in Chrome 59 if it is the same bug as listed here: https://bugs.chromium.org/p/chromium/issues/detail?id=602968

Also - it's probably a better practice to only include font-face declarations once. We solved the issue by refactoring our CSS architecture and only including font-faces once.

查看更多
登录 后发表回答