Can't load multiple fonts from google font API
See original GitHub issue.loadFonts() when (@importGoogleFonts) {
@import url('@{googleProtocol}fonts.googleapis.com/css?family=@{googleFontRequest}');
}
@googleFontName : @fontName;
@importGoogleFonts : true;
@googleFontSizes : '400,700,400italic,700italic';
@googleSubset : 'latin';
@googleProtocol : 'https://';
@googleFontRequest : '@{googleFontName}:@{googleFontSizes}&subset=@{googleSubset}';
If I set @fontName to multiple values, or use different fonts for @pageFont and @headerFont, the @googleFontRequest will not work.
I have checked the Google font API, a working request URL may be like this:
font-1:@{googleFontSizes}|font-2:@{googleFontSizes}|font-3:@{googleFontSizes}&subset=@{googleSubset}
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Loading multiple Google Fonts in 1 request violates HTML ...
Of course I can separate two fonts in two requests as follow, but the load time will be doubled. <link rel="stylesheet" type="text/css" href ......
Read more >How to Load Multiple Google Fonts in One URL Request
Loading google font is easy. If we visit Google Font page, for example Open Sans Font. we can see the instruction to add...
Read more >Troubleshooting | Google Fonts
By default the NoScript plugin disables @font-face rules. Solution. Open the NoScript Options, go to the Embeddings tab and uncheck: Forbid @font-face. Web ......
Read more >Loading variable fonts on the web – Fonts Knowledge
Loading variable fonts from a font delivery service ... Google Fonts because, at the time of writing, Adobe Fonts doesn't serve variable fonts...
Read more >A Guide to Google Font API
Tip: Using too many fonts in one request may slow down page response times. So load only the fonts you need. Be conservative:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I did it directly changing the
@googleFontRequest:
That will generate the exact line for include fonts:
@import url('https://fonts.googleapis.com/css?family=Poppins:400,500|Pragati+Narrow:400,700');
Hi @tarvos21, I’m not familiar with Google Fonts, as I tend to self-host the fonts, but have you tried changing
@googleFontRequest
to make it look like the suggested Google Font API request?