I'm building a new WordPress theme (don't know if that's relevant) and there's this issue that keeps bugging me.
I've loaded up Roboto Slab from Google Webfonts (included the CSS in <head>
section). On every other browser out there, font is rendered OK, except Google Chrome. When I first load up the website in Google Chrome, texts using that custom font are NOT displayed AT ALL (even tho font-stack has Georgia as a fallback - "Roboto Slab", Georgia, serif;
). After I hover the styled link, or retrigger any CSS property in Inspector - texts become visible.
Since I've started the theme some time ago, I can clearly remember that it was working perfectly before. Is this some known recent Chrome update bug?
First load: a screenshot #1
After I reapply any of the CSS properties, get into responsive view or hover an element: a screenshot #2
Anyone have similar issues? How should I proceed with this?
Thanks!
I was trying to work with Meg's answer,but like many others it didn't work for me either.
For using Google Font,found this trick[Adding Screenshots for steps].
1) Just take the url from the css or standard link as highlighted.
2) Open the link in another tab, copy whole css code(i.e. font-face) in your css file and run.
Not sure about performance as many http calls are getting added, or just try copying one font-face.
Image for step 1
Image for step 2
If people are still having this problem before you try all the great solutions on here try using an !important tag in your css to see if that will fix it, as it did for me and I am not sure if the bug is the same as the old Chrome bug.
See similar problem in question Strange Issue while Google Font Rendering.
Solution is in loading the desired font (I my case 'Fira Sans') from the Mozilla CDN instead of Google CDN.
It is not a actual solution but it works better for me than everything else in this thread. I changed the font. I had Fira Sans and now just changed to Roboto which works out of the box.
I'm just sharing what worked for me. Your results may vary.
I had
main.css
with an@import
of multiple fonts, separated by a|
(pipe) character. This had been working up until today. I kept all of my Google Font imports in the main CSS file because I didn't have that many. Today I added one that simply wouldn't render, either in Chrome or Firefox. I tried a different font - same problem.Finally, I made a separate
@import
in another CSS file that gets loaded for several pages on the site (let's call itnavbar_pages.css
, for example) - this CSS gets included in the relevant pages via<link rel="stylesheet" type="text/css" href="/css/navbar_pages.css">
, just likemain.css
does.For some reason, having the @import in a separate CSS file solved the problem.
I suspect it is due to a limit on the number of fonts that can be called in a single
@import
call. More testing should be done to pin down the cause, but for now there is my workaround. If anyone has insights, please chime in with a comment.Tried the css fix alone above with no success. Finally resolved by creating a style sheet (chrome.css) containing:
And loading it with jquery at the bottom of the page: