Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Huge number of webfonts in basic install

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 03-14-2017, 07:00 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Huge number of webfonts in basic install

Using this tool http://yellowlab.tools I've discovered that my site is loading 58 webfonts!

In View/CommonResources I found this:

Code:
array( 'url' => '//fonts.googleapis.com/css?family=' . urlencode('Open Sans:300italic,400italic,600italic,700italic,400,300,600,700') . '&subset=' . urlencode('latin,cyrillic,latin-ext'), 'media' => 'not print', ),

Should I over-ride this?

I imagine I only need this Open+Sans:300,400,700 and the latin subset for a European language site?
__________________
Core version: 5.5.xx
Reply With Quote
  #2  
Old 03-14-2017, 10:29 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Huge number of webfonts in basic install

I believe it is not that code that adds these 58 fonts - I've tried to check my XC5 installation with that website and it states that my site has 4 fonts only.

What is the list of your 58 fonts?
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 03-15-2017, 01:15 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Re: Huge number of webfonts in basic install

Here's a test for a basic install..

http://yellowlab.tools/result/eo09vuo23z

showing 30 fonts http://yellowlab.tools/result/eo09vuo23z/rule/fontsCount

I'm pretty sure that these are loaded as one file by the browser but there's still the bandwidth to consider. Although there is this Our cross-site caching is designed so that you only need to load a font once, with any website, and we'll use that same cached font on any other website that uses Google Fonts..

I see this in the header:
<link href="http://fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600 italic%2C700italic%2C400%2C300%2C600%2C700&amp;sub set=latin%2Ccyrillic%2Clatin-ext&amp;1487706193" rel="stylesheet" type="text/css" media="not print" />

which must be coming from

Code:
'Open Sans:300italic,400italic,600italic,700italic,400,300,600,700') . '&subset=' . urlencode('latin,cyrillic,latin-ext'

The site doesn't need Cyrillic or latin-ext characters and the italics can be simulated (and are possibly cached anyway) so I would just use 300,400,700.
__________________
Core version: 5.5.xx
Reply With Quote
  #4  
Old 03-15-2017, 03:49 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Huge number of webfonts in basic install

Oh, you are right! It is the same in Crisp White theme for me.
I've reported this to the XC5 dev team.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #5  
Old 03-16-2017, 01:08 PM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Re: Huge number of webfonts in basic install

I'm not sure this is the best way of doing this with regard to caching of previously loaded fonts but this really brings down the number of fonts loaded.

<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&text=abcdefghijkl mnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!%22#$£%& '()*+,-./0123456789:;<=>?@[\]^_`{|}~" rel="stylesheet">
__________________
Core version: 5.5.xx
Reply With Quote
  #6  
Old 03-17-2017, 01:41 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Re: Huge number of webfonts in basic install

Further reading.. https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization

Looks like the browsers (some of them at least) only download the parts of the font needed to show the page. There's an explanation at the end of the page for this.

I'm looking into getting a subset of the font loaded earlier so the visible content can be output to the browser sooner.
__________________
Core version: 5.5.xx
Reply With Quote
  #7  
Old 03-17-2017, 06:13 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Re: Huge number of webfonts in basic install

more interesting reading...

https://www.zachleat.com/web/comprehensive-webfonts/
__________________
Core version: 5.5.xx
Reply With Quote
  #8  
Old 04-27-2017, 10:10 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Huge number of webfonts in basic install

I've got a reply from the XC5 dev team. They made a number of tests and found that browsers loads only the fonts that are used on the page. You may check this on the Network tab of the browser's developer console.

Also, this link confirms this partially:
https://github.com/google/fonts/issues/113
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:22 AM.

   

 
X-Cart forums © 2001-2020