Table of Contents
Sometimes users are wants to know how to fix google fonts not loading in china. Some Google Fonts haven’t made it into the Google Fonts Directory yet, but you can still use them and let Google know if they need to be fixed. At the same time, Google fixed Google Fonts so that the CSS and font files are now served directly from Google’s servers in Beijing. This means that users in China can now use Google Fonts much more reliably and quickly.
In China, however, that’s not the case. In 2014, China shut down access to many Google services, including Google API. There’s a good chance that your website will look broken in China because jQuery and web fonts hosted by Google can’t be reached. We advise all webmasters who have been using fonts.useso.com to switch back as soon as possible to the original Google Fonts.
Since June, Google’s services in China have been much less stable than ever before. Before that, Google Web Search and Gmail were sometimes usable, but now it’s safe to say that they are almost never usable. This time, Google Fonts has been added to the list of people who have been hurt. Google Fonts is a free service that makes it easy to add beautiful fonts that work in all browsers to websites.
Ways to fix google fonts not loading in china
Providing Alternative Web Font Source
So, now that we know where our visitors are from, we will replace Google Fonts with Useso libraries, a CDN service that mirrors Fonts and Libraries from Google API, to serve visitors from China.
- At this stage, we still have our font styles pointing to Google API:
<link href='http://fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'>
- We will replace the href within the link element with a JavaScript function.
function replaceGoogleCDN() {
$('link').each(function(){
var $intial = $(this).attr('href'),
$replace = $intial.replace('//fonts.googleapis.com/', '//fonts.useso.com/');
$(this).attr('href', $replace);
- This function replaces each link to refer to //fonts.useso.com/ in place of pointing to Google API address, //fonts.googleapis.com/.
- The function will run only when the visitor is from CN, China’s international country code.
$.getJSON('http://api.wipmania.com/jsonp?callback=?', function (data) {
if ( data.address.country_code == 'CN' ) {
replaceGoogleCDN();
- We are all set. Now, visitors from China will be served fonts via //fonts.useso.com/, which is not blocked by the Chinese government.
Identifying User Location
First, we need to find out where our visitor is from. To do this, we will use this WIPMania API, which lets us get a visitor’s geolocation and country name:
$.getJSON('http://api.wipmania.com/jsonp?callback=?', function (data) {
swal('You are from', data.address.country);
- We call the API with jQuery $.getJSON. Then, we send the visitor’s data.address.country, which should tell us where they are from.
FAQ
Which Google Fonts support Chinese?
Noto Sans TC is a design for languages in Taiwan and Macau that use the Traditional Chinese version of the Han ideograms. It is a non-modulated (or “sans serif”) font. It also supports Hiragana, Katakana, Latin, Cyrillic, Greek and Hangul.
Why Google is not working in China?
In 2010, the U.S. tech giant pulled its search engine out of China because the government there was very strict about censoring the internet. The Chinese government also blocks access to its other services, like Google Maps and Gmail.
What happens if you use Google in China?
Let’s start with a simple question: Is Google blocked in China? And the simple answer is yes, it is. But Google is in good company when it comes to being censored in China.
What is the best font for China?
Sim Sun is the Chinese font that is used the most. It is very popular because Windows uses it as the default Chinese input font. Song Ti is probably the oldest Chinese font used in China. It dates back to the Song Dynasty (960-1279), when printing technology was booming.