I am trying to use google fonts in a simple vaadin14 application. At first glance, I can import the desired font and I can use that, despite this the browsers ( Chrom and Safari ) can’t use it.
Here is my shared-style config:
As you can see on the attachement ( in Chrome ) , the computed font-family is Nunito, but the rendered font is Arial. The font loaded properly.
Where is the problem? Why the browser can’t use the font type?
Thank’s the answers!
Viktor
Hi Joacim!
Thank you for your quick answer!
At first, your solution is working correctly!
But it is interestening, why doesn’t work my original code, because I can see the downloaded CSS from Google Fonts API but I can’t see the woff2 files via Chrome Network view. The URL is the same in both cases, so shouldn’t be there any typo. Have you any idea?
In other hand, how can I use font awesome fonts? I have downloaded the neccessary library, and put into resources/font folder and added a link to InitialPageSettings, similar than your solution.
The good news that fontawesome is working properly! I just made a mistake, because after I added the proper URL to InitialPageSettings, I made a simple css class in the shared-styles.js file.