As a developer in China, I have noticed that the urls for Google Fonts are blocked and slow down web page loading. To optimize my website, I need to replace the Google Fonts url with fonts.sourcegcdn.com. However, I am wondering if there is a way to change Google Fonts so that it loads faster.
The solution being worked on is to enable self-hosting of Google fonts. This means that instead of relying on external sources like fonts.googleapis.com, the fonts will be hosted on the website's own servers.
One possible code example of how this can be implemented is by downloading the Google Font files and uploading them to the website's server. Then, the CSS code can be modified to reference the local font files instead of the external source.
This will reduce the dependence on external sources and improve the loading speed of the website, especially for users in China where the Google Fonts url is blocked. The progress of this feature can be tracked on the GitHub issue linked above.