X

How to swap out google fonts for China users?

Currently a custom protocol is used, will create and release library soon!

Check out ajax.php , the method “get_visitor_country” and go through the flow. Create a library from this.

 

To use:

  1.  Find the google fonts that are used on the page.
  2. Download them using: https://google-webfonts-helper.herokuapp.com/
  3. You should open the link i.e. “https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700|Roboto:300,400,500,700&display=swap” to see what settings to download on the herokuapp page.
  4. Now create a new CSS file i.e. /static/china_fonts/vip_page.css
  5. On the herokuapp page, enter the path/folder name you will place the font files for that font (Customize folder prefix (optional):)  i.e. source_sans_pro/
  6. Create the folder in Step 5, i.e. /static/china_fonts/source_sans_pro
  7. Download the fonts.zip file from herokuapp page, and extract the font files into the folder in Step 6.
  8. Look for // <!– step 1: china google fonts –> in controllers/pages.php , load AJAX library
  9. Look for <!– step 2: china google fonts –>  in views/pages/say_that_you_love_me/en/php
  10. Look for <!– step 3: china google fonts –> to run the ajax message in the same file in Step 9.
  11. That’s it!

 

Bad Joe: